{"ast":null,"code":"var niceErrors = {\n  0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n  1: function _(annotationType, key) {\n    return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n  },\n  /*\r\n  2(prop) {\r\n      return `invalid decorator for '${prop.toString()}'`\r\n  },\r\n  3(prop) {\r\n      return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n  },\r\n  4(prop) {\r\n      return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n  },\r\n  */\n  5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n  6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n  7: \"'entries()' can only be used on observable objects, arrays and maps\",\n  8: \"'set()' can only be used on observable objects, arrays and maps\",\n  9: \"'remove()' can only be used on observable objects, arrays and maps\",\n  10: \"'has()' can only be used on observable objects, arrays and maps\",\n  11: \"'get()' can only be used on observable objects, arrays and maps\",\n  12: \"Invalid annotation\",\n  13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n  14: \"Intercept handlers should return nothing or a change object\",\n  15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n  16: \"Modification exception: the internal structure of an observable array was changed.\",\n  17: function _(index, length) {\n    return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n  },\n  18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n  19: function _(other) {\n    return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n  },\n  20: function _(other) {\n    return \"Cannot initialize map from \" + other;\n  },\n  21: function _(dataStructure) {\n    return \"Cannot convert to map from '\" + dataStructure + \"'\";\n  },\n  22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n  23: \"It is not possible to get index atoms from arrays\",\n  24: function _(thing) {\n    return \"Cannot obtain administration from \" + thing;\n  },\n  25: function _(property, name) {\n    return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n  },\n  26: \"please specify a property\",\n  27: function _(property, name) {\n    return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n  },\n  28: function _(thing) {\n    return \"Cannot obtain atom from \" + thing;\n  },\n  29: \"Expecting some object\",\n  30: \"invalid action stack. did you forget to finish an action?\",\n  31: \"missing option for computed: get\",\n  32: function _(name, derivation) {\n    return \"Cycle detected in computation \" + name + \": \" + derivation;\n  },\n  33: function _(name) {\n    return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n  },\n  34: function _(name) {\n    return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n  },\n  35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n  36: \"isolateGlobalState should be called before MobX is running any reactions\",\n  37: function _(method) {\n    return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n  },\n  38: \"'ownKeys()' can only be used on observable objects\",\n  39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = process.env.NODE_ENV !== \"production\" ? niceErrors : {};\nfunction die(error) {\n  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n    args[_key - 1] = arguments[_key];\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    var e = typeof error === \"string\" ? error : errors[error];\n    if (typeof e === \"function\") e = e.apply(null, args);\n    throw new Error(\"[MobX] \" + e);\n  }\n  throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\nvar mockGlobal = {};\nfunction getGlobal() {\n  if (typeof globalThis !== \"undefined\") {\n    return globalThis;\n  }\n  if (typeof window !== \"undefined\") {\n    return window;\n  }\n  if (typeof global !== \"undefined\") {\n    return global;\n  }\n  if (typeof self !== \"undefined\") {\n    return self;\n  }\n  return mockGlobal;\n}\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n  if (!hasProxy) {\n    die(process.env.NODE_ENV !== \"production\" ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : \"Proxy not available\");\n  }\n}\nfunction warnAboutProxyRequirement(msg) {\n  if (process.env.NODE_ENV !== \"production\" && globalState.verifyProxies) {\n    die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n  }\n}\nfunction getNextId() {\n  return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n  var invoked = false;\n  return function () {\n    if (invoked) {\n      return;\n    }\n    invoked = true;\n    return func.apply(this, arguments);\n  };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n  return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n  var t = typeof value;\n  switch (t) {\n    case \"string\":\n    case \"symbol\":\n    case \"number\":\n      return true;\n  }\n  return false;\n}\nfunction isObject(value) {\n  return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n  if (!isObject(value)) {\n    return false;\n  }\n  var proto = Object.getPrototypeOf(value);\n  if (proto == null) {\n    return true;\n  }\n  var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n  return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n  var constructor = obj == null ? void 0 : obj.constructor;\n  if (!constructor) {\n    return false;\n  }\n  if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n    return true;\n  }\n  return false;\n}\nfunction addHiddenProp(object, propName, value) {\n  defineProperty(object, propName, {\n    enumerable: false,\n    writable: true,\n    configurable: true,\n    value: value\n  });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n  defineProperty(object, propName, {\n    enumerable: false,\n    writable: false,\n    configurable: true,\n    value: value\n  });\n}\nfunction createInstanceofPredicate(name, theClass) {\n  var propName = \"isMobX\" + name;\n  theClass.prototype[propName] = true;\n  return function (x) {\n    return isObject(x) && x[propName] === true;\n  };\n}\nfunction isES6Map(thing) {\n  return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n  return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n  var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n  if (!hasGetOwnPropertySymbols) {\n    return keys;\n  }\n  var symbols = Object.getOwnPropertySymbols(object);\n  if (!symbols.length) {\n    return keys;\n  }\n  return [].concat(keys, symbols.filter(function (s) {\n    return objectPrototype.propertyIsEnumerable.call(object, s);\n  }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n  return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n  if (typeof key === \"string\") {\n    return key;\n  }\n  if (typeof key === \"symbol\") {\n    return key.toString();\n  }\n  return new String(key).toString();\n}\nfunction toPrimitive(value) {\n  return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n  return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n  // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n  var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n  ownKeys(target).forEach(function (key) {\n    res[key] = getDescriptor(target, key);\n  });\n  return res;\n};\nfunction _defineProperties(target, props) {\n  for (var i = 0; i < props.length; i++) {\n    var descriptor = props[i];\n    descriptor.enumerable = descriptor.enumerable || false;\n    descriptor.configurable = true;\n    if (\"value\" in descriptor) descriptor.writable = true;\n    Object.defineProperty(target, descriptor.key, descriptor);\n  }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n  if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n  if (staticProps) _defineProperties(Constructor, staticProps);\n  Object.defineProperty(Constructor, \"prototype\", {\n    writable: false\n  });\n  return Constructor;\n}\nfunction _extends() {\n  _extends = Object.assign || function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n    return target;\n  };\n  return _extends.apply(this, arguments);\n}\nfunction _inheritsLoose(subClass, superClass) {\n  subClass.prototype = Object.create(superClass.prototype);\n  subClass.prototype.constructor = subClass;\n  _setPrototypeOf(subClass, superClass);\n}\nfunction _setPrototypeOf(o, p) {\n  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n    o.__proto__ = p;\n    return o;\n  };\n  return _setPrototypeOf(o, p);\n}\nfunction _assertThisInitialized(self) {\n  if (self === void 0) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n  return self;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n  if (!o) return;\n  if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n  var n = Object.prototype.toString.call(o).slice(8, -1);\n  if (n === \"Object\" && o.constructor) n = o.constructor.name;\n  if (n === \"Map\" || n === \"Set\") return Array.from(o);\n  if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n  if (len == null || len > arr.length) len = arr.length;\n  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n  return arr2;\n}\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n  var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n  if (it) return (it = it.call(o)).next.bind(it);\n  if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n    if (it) o = it;\n    var i = 0;\n    return function () {\n      if (i >= o.length) return {\n        done: true\n      };\n      return {\n        done: false,\n        value: o[i++]\n      };\n    };\n  }\n  throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n  function decorator(target, property) {\n    storeAnnotation(target, property, annotation);\n  }\n  return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n  if (!hasProp(prototype, storedAnnotationsSymbol)) {\n    addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n  } // @override must override something\n\n  if (process.env.NODE_ENV !== \"production\" && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n    var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n    die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n  } // Cannot re-decorate\n\n  assertNotDecorated(prototype, annotation, key); // Ignore override\n\n  if (!isOverride(annotation)) {\n    prototype[storedAnnotationsSymbol][key] = annotation;\n  }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n  if (process.env.NODE_ENV !== \"production\" && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n    var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n    var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n    var requestedAnnotationType = annotation.annotationType_;\n    die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n  }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\nfunction collectStoredAnnotations(target) {\n  if (!hasProp(target, storedAnnotationsSymbol)) {\n    if (process.env.NODE_ENV !== \"production\" && !target[storedAnnotationsSymbol]) {\n      die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n    } // We need a copy as we will remove annotation from the list once it's applied.\n\n    addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n  }\n  return target[storedAnnotationsSymbol];\n}\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n  // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n  /**\r\n   * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n   * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n   */\n  function Atom(name_) {\n    if (name_ === void 0) {\n      name_ = process.env.NODE_ENV !== \"production\" ? \"Atom@\" + getNextId() : \"Atom\";\n    }\n    this.name_ = void 0;\n    this.isPendingUnobservation_ = false;\n    this.isBeingObserved_ = false;\n    this.observers_ = new Set();\n    this.diffValue_ = 0;\n    this.lastAccessedBy_ = 0;\n    this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n    this.onBOL = void 0;\n    this.onBUOL = void 0;\n    this.name_ = name_;\n  } // onBecomeObservedListeners\n\n  var _proto = Atom.prototype;\n  _proto.onBO = function onBO() {\n    if (this.onBOL) {\n      this.onBOL.forEach(function (listener) {\n        return listener();\n      });\n    }\n  };\n  _proto.onBUO = function onBUO() {\n    if (this.onBUOL) {\n      this.onBUOL.forEach(function (listener) {\n        return listener();\n      });\n    }\n  }\n  /**\r\n   * Invoke this method to notify mobx that your atom has been used somehow.\r\n   * Returns true if there is currently a reactive context.\r\n   */;\n\n  _proto.reportObserved = function reportObserved$1() {\n    return reportObserved(this);\n  }\n  /**\r\n   * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n   */;\n\n  _proto.reportChanged = function reportChanged() {\n    startBatch();\n    propagateChanged(this);\n    endBatch();\n  };\n  _proto.toString = function toString() {\n    return this.name_;\n  };\n  return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n  if (onBecomeObservedHandler === void 0) {\n    onBecomeObservedHandler = noop;\n  }\n  if (onBecomeUnobservedHandler === void 0) {\n    onBecomeUnobservedHandler = noop;\n  }\n  var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n  if (onBecomeObservedHandler !== noop) {\n    onBecomeObserved(atom, onBecomeObservedHandler);\n  }\n  if (onBecomeUnobservedHandler !== noop) {\n    onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n  }\n  return atom;\n}\nfunction identityComparer(a, b) {\n  return a === b;\n}\nfunction structuralComparer(a, b) {\n  return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n  return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n  if (Object.is) {\n    return Object.is(a, b);\n  }\n  return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n  identity: identityComparer,\n  structural: structuralComparer,\n  \"default\": defaultComparer,\n  shallow: shallowComparer\n};\nfunction deepEnhancer(v, _, name) {\n  // it is an observable already, done\n  if (isObservable(v)) {\n    return v;\n  } // something that can be converted and mutated?\n\n  if (Array.isArray(v)) {\n    return observable.array(v, {\n      name: name\n    });\n  }\n  if (isPlainObject(v)) {\n    return observable.object(v, undefined, {\n      name: name\n    });\n  }\n  if (isES6Map(v)) {\n    return observable.map(v, {\n      name: name\n    });\n  }\n  if (isES6Set(v)) {\n    return observable.set(v, {\n      name: name\n    });\n  }\n  if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n    if (isGenerator(v)) {\n      return flow(v);\n    } else {\n      return autoAction(name, v);\n    }\n  }\n  return v;\n}\nfunction shallowEnhancer(v, _, name) {\n  if (v === undefined || v === null) {\n    return v;\n  }\n  if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n    return v;\n  }\n  if (Array.isArray(v)) {\n    return observable.array(v, {\n      name: name,\n      deep: false\n    });\n  }\n  if (isPlainObject(v)) {\n    return observable.object(v, undefined, {\n      name: name,\n      deep: false\n    });\n  }\n  if (isES6Map(v)) {\n    return observable.map(v, {\n      name: name,\n      deep: false\n    });\n  }\n  if (isES6Set(v)) {\n    return observable.set(v, {\n      name: name,\n      deep: false\n    });\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n  }\n}\nfunction referenceEnhancer(newValue) {\n  // never turn into an observable\n  return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n  if (process.env.NODE_ENV !== \"production\" && isObservable(v)) {\n    die(\"observable.struct should not be used with observable values\");\n  }\n  if (deepEqual(v, oldValue)) {\n    return oldValue;\n  }\n  return v;\n}\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n  annotationType_: OVERRIDE,\n  make_: make_,\n  extend_: extend_\n});\nfunction isOverride(annotation) {\n  return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n  // Must not be plain object\n  if (process.env.NODE_ENV !== \"production\" && adm.isPlainObject_) {\n    die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n  } // Must override something\n\n  if (process.env.NODE_ENV !== \"production\" && !hasProp(adm.appliedAnnotations_, key)) {\n    die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n  }\n  return 0\n  /* Cancel */;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n  die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\nfunction createActionAnnotation(name, options) {\n  return {\n    annotationType_: name,\n    options_: options,\n    make_: make_$1,\n    extend_: extend_$1\n  };\n}\nfunction make_$1(adm, key, descriptor, source) {\n  var _this$options_;\n\n  // bound\n  if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n    return this.extend_(adm, key, descriptor, false) === null ? 0\n    /* Cancel */ : 1\n    /* Break */;\n  } // own\n\n  if (source === adm.target_) {\n    return this.extend_(adm, key, descriptor, false) === null ? 0\n    /* Cancel */ : 2\n    /* Continue */;\n  } // prototype\n\n  if (isAction(descriptor.value)) {\n    // A prototype could have been annotated already by other constructor,\n    // rest of the proto chain must be annotated already\n    return 1\n    /* Break */;\n  }\n\n  var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n  defineProperty(source, key, actionDescriptor);\n  return 2\n  /* Continue */;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n  var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n  return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n  var annotationType_ = _ref.annotationType_;\n  var value = _ref2.value;\n  if (process.env.NODE_ENV !== \"production\" && !isFunction(value)) {\n    die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n  }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n  var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n  if (safeDescriptors === void 0) {\n    safeDescriptors = globalState.safeDescriptors;\n  }\n  assertActionDescriptor(adm, annotation, key, descriptor);\n  var value = descriptor.value;\n  if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n    var _adm$proxy_;\n    value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n  }\n  return {\n    value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n    // https://github.com/mobxjs/mobx/discussions/3140\n    (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n    // Non-configurable for classes\n    // prevents accidental field redefinition in subclass\n    configurable: safeDescriptors ? adm.isPlainObject_ : true,\n    // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n    enumerable: false,\n    // Non-obsevable, therefore non-writable\n    // Also prevents rewriting in subclass constructor\n    writable: safeDescriptors ? false : true\n  };\n}\nfunction createFlowAnnotation(name, options) {\n  return {\n    annotationType_: name,\n    options_: options,\n    make_: make_$2,\n    extend_: extend_$2\n  };\n}\nfunction make_$2(adm, key, descriptor, source) {\n  var _this$options_;\n\n  // own\n  if (source === adm.target_) {\n    return this.extend_(adm, key, descriptor, false) === null ? 0\n    /* Cancel */ : 2\n    /* Continue */;\n  } // prototype\n  // bound - must annotate protos to support super.flow()\n\n  if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n    if (this.extend_(adm, key, descriptor, false) === null) {\n      return 0\n      /* Cancel */;\n    }\n  }\n\n  if (isFlow(descriptor.value)) {\n    // A prototype could have been annotated already by other constructor,\n    // rest of the proto chain must be annotated already\n    return 1\n    /* Break */;\n  }\n\n  var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n  defineProperty(source, key, flowDescriptor);\n  return 2\n  /* Continue */;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n  var _this$options_2;\n  var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n  return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n  var annotationType_ = _ref.annotationType_;\n  var value = _ref2.value;\n  if (process.env.NODE_ENV !== \"production\" && !isFunction(value)) {\n    die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n  }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n  if (safeDescriptors === void 0) {\n    safeDescriptors = globalState.safeDescriptors;\n  }\n  assertFlowDescriptor(adm, annotation, key, descriptor);\n  var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype\n\n  if (!isFlow(value)) {\n    value = flow(value);\n  }\n  if (bound) {\n    var _adm$proxy_;\n\n    // We do not keep original function around, so we bind the existing flow\n    value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...\n\n    value.isMobXFlow = true;\n  }\n  return {\n    value: value,\n    // Non-configurable for classes\n    // prevents accidental field redefinition in subclass\n    configurable: safeDescriptors ? adm.isPlainObject_ : true,\n    // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n    enumerable: false,\n    // Non-obsevable, therefore non-writable\n    // Also prevents rewriting in subclass constructor\n    writable: safeDescriptors ? false : true\n  };\n}\nfunction createComputedAnnotation(name, options) {\n  return {\n    annotationType_: name,\n    options_: options,\n    make_: make_$3,\n    extend_: extend_$3\n  };\n}\nfunction make_$3(adm, key, descriptor) {\n  return this.extend_(adm, key, descriptor, false) === null ? 0\n  /* Cancel */ : 1\n  /* Break */;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n  assertComputedDescriptor(adm, this, key, descriptor);\n  return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n    get: descriptor.get,\n    set: descriptor.set\n  }), proxyTrap);\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n  var annotationType_ = _ref.annotationType_;\n  var get = _ref2.get;\n  if (process.env.NODE_ENV !== \"production\" && !get) {\n    die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n  }\n}\nfunction createObservableAnnotation(name, options) {\n  return {\n    annotationType_: name,\n    options_: options,\n    make_: make_$4,\n    extend_: extend_$4\n  };\n}\nfunction make_$4(adm, key, descriptor) {\n  return this.extend_(adm, key, descriptor, false) === null ? 0\n  /* Cancel */ : 1\n  /* Break */;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n  var _this$options_$enhanc, _this$options_;\n  assertObservableDescriptor(adm, this, key, descriptor);\n  return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n  var annotationType_ = _ref.annotationType_;\n  if (process.env.NODE_ENV !== \"production\" && !(\"value\" in descriptor)) {\n    die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n  }\n}\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n  return {\n    annotationType_: AUTO,\n    options_: options,\n    make_: make_$5,\n    extend_: extend_$5\n  };\n}\nfunction make_$5(adm, key, descriptor, source) {\n  var _this$options_3, _this$options_4;\n\n  // getter -> computed\n  if (descriptor.get) {\n    return computed.make_(adm, key, descriptor, source);\n  } // lone setter -> action setter\n\n  if (descriptor.set) {\n    // TODO make action applicable to setter and delegate to action.make_\n    var set = createAction(key.toString(), descriptor.set); // own\n\n    if (source === adm.target_) {\n      return adm.defineProperty_(key, {\n        configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n        set: set\n      }) === null ? 0\n      /* Cancel */ : 2\n      /* Continue */;\n    } // proto\n\n    defineProperty(source, key, {\n      configurable: true,\n      set: set\n    });\n    return 2\n    /* Continue */;\n  } // function on proto -> autoAction/flow\n\n  if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n    var _this$options_2;\n    if (isGenerator(descriptor.value)) {\n      var _this$options_;\n      var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n      return flowAnnotation.make_(adm, key, descriptor, source);\n    }\n    var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n    return actionAnnotation.make_(adm, key, descriptor, source);\n  } // other -> observable\n  // Copy props from proto as well, see test:\n  // \"decorate should work with Object.create\"\n\n  var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n  if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n    var _adm$proxy_;\n    descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n  }\n  return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n  var _this$options_5, _this$options_6;\n\n  // getter -> computed\n  if (descriptor.get) {\n    return computed.extend_(adm, key, descriptor, proxyTrap);\n  } // lone setter -> action setter\n\n  if (descriptor.set) {\n    // TODO make action applicable to setter and delegate to action.extend_\n    return adm.defineProperty_(key, {\n      configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n      set: createAction(key.toString(), descriptor.set)\n    }, proxyTrap);\n  } // other -> observable\n  // if function respect autoBind option\n\n  if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n    var _adm$proxy_2;\n    descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n  }\n  var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n  return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\"; // Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n  deep: true,\n  name: undefined,\n  defaultDecorator: undefined,\n  proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n  return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n  enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n  enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n  enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n  return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n  var _options$defaultDecor;\n  return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n  var _annotation$options_$, _annotation$options_;\n  return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n  // @observable someProp;\n  if (isStringish(arg2)) {\n    storeAnnotation(v, arg2, observableAnnotation);\n    return;\n  } // already observable - ignore\n\n  if (isObservable(v)) {\n    return v;\n  } // plain object\n\n  if (isPlainObject(v)) {\n    return observable.object(v, arg2, arg3);\n  } // Array\n\n  if (Array.isArray(v)) {\n    return observable.array(v, arg2);\n  } // Map\n\n  if (isES6Map(v)) {\n    return observable.map(v, arg2);\n  } // Set\n\n  if (isES6Set(v)) {\n    return observable.set(v, arg2);\n  } // other object - ignore\n\n  if (typeof v === \"object\" && v !== null) {\n    return v;\n  } // anything else\n\n  return observable.box(v, arg2);\n}\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n  box: function box(value, options) {\n    var o = asCreateObservableOptions(options);\n    return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n  },\n  array: function array(initialValues, options) {\n    var o = asCreateObservableOptions(options);\n    return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n  },\n  map: function map(initialValues, options) {\n    var o = asCreateObservableOptions(options);\n    return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n  },\n  set: function set(initialValues, options) {\n    var o = asCreateObservableOptions(options);\n    return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n  },\n  object: function object(props, decorators, options) {\n    return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n  },\n  ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n  shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n  deep: observableDecoratorAnnotation,\n  struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n  equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n  if (isStringish(arg2)) {\n    // @computed\n    return storeAnnotation(arg1, arg2, computedAnnotation);\n  }\n  if (isPlainObject(arg1)) {\n    // @computed({ options })\n    return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n  } // computed(expr, options?)\n\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isFunction(arg1)) {\n      die(\"First argument to `computed` should be an expression.\");\n    }\n    if (isFunction(arg2)) {\n      die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n    }\n  }\n  var opts = isPlainObject(arg2) ? arg2 : {};\n  opts.get = arg1;\n  opts.name || (opts.name = arg1.name || \"\");\n  /* for generated name */\n\n  return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n  value: \"action\",\n  configurable: true,\n  writable: false,\n  enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n  if (autoAction === void 0) {\n    autoAction = false;\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isFunction(fn)) {\n      die(\"`action` can only be invoked on functions\");\n    }\n    if (typeof actionName !== \"string\" || !actionName) {\n      die(\"actions should have valid names, got: '\" + actionName + \"'\");\n    }\n  }\n  function res() {\n    return executeAction(actionName, autoAction, fn, ref || this, arguments);\n  }\n  res.isMobxAction = true;\n  if (isFunctionNameConfigurable) {\n    tmpNameDescriptor.value = actionName;\n    Object.defineProperty(res, \"name\", tmpNameDescriptor);\n  }\n  return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n  var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n  try {\n    return fn.apply(scope, args);\n  } catch (err) {\n    runInfo.error_ = err;\n    throw err;\n  } finally {\n    _endAction(runInfo);\n  }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n  var notifySpy_ = process.env.NODE_ENV !== \"production\" && isSpyEnabled() && !!actionName;\n  var startTime_ = 0;\n  if (process.env.NODE_ENV !== \"production\" && notifySpy_) {\n    startTime_ = Date.now();\n    var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n    spyReportStart({\n      type: ACTION,\n      name: actionName,\n      object: scope,\n      arguments: flattenedArgs\n    });\n  }\n  var prevDerivation_ = globalState.trackingDerivation;\n  var runAsAction = !canRunAsDerivation || !prevDerivation_;\n  startBatch();\n  var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n  if (runAsAction) {\n    untrackedStart();\n    prevAllowStateChanges_ = allowStateChangesStart(true);\n  }\n  var prevAllowStateReads_ = allowStateReadsStart(true);\n  var runInfo = {\n    runAsAction_: runAsAction,\n    prevDerivation_: prevDerivation_,\n    prevAllowStateChanges_: prevAllowStateChanges_,\n    prevAllowStateReads_: prevAllowStateReads_,\n    notifySpy_: notifySpy_,\n    startTime_: startTime_,\n    actionId_: nextActionId++,\n    parentActionId_: currentActionId\n  };\n  currentActionId = runInfo.actionId_;\n  return runInfo;\n}\nfunction _endAction(runInfo) {\n  if (currentActionId !== runInfo.actionId_) {\n    die(30);\n  }\n  currentActionId = runInfo.parentActionId_;\n  if (runInfo.error_ !== undefined) {\n    globalState.suppressReactionErrors = true;\n  }\n  allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n  allowStateReadsEnd(runInfo.prevAllowStateReads_);\n  endBatch();\n  if (runInfo.runAsAction_) {\n    untrackedEnd(runInfo.prevDerivation_);\n  }\n  if (process.env.NODE_ENV !== \"production\" && runInfo.notifySpy_) {\n    spyReportEnd({\n      time: Date.now() - runInfo.startTime_\n    });\n  }\n  globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n  var prev = allowStateChangesStart(allowStateChanges);\n  try {\n    return func();\n  } finally {\n    allowStateChangesEnd(prev);\n  }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n  var prev = globalState.allowStateChanges;\n  globalState.allowStateChanges = allowStateChanges;\n  return prev;\n}\nfunction allowStateChangesEnd(prev) {\n  globalState.allowStateChanges = prev;\n}\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n  _inheritsLoose(ObservableValue, _Atom);\n  function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n    var _this;\n    if (name_ === void 0) {\n      name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableValue@\" + getNextId() : \"ObservableValue\";\n    }\n    if (notifySpy === void 0) {\n      notifySpy = true;\n    }\n    if (equals === void 0) {\n      equals = comparer[\"default\"];\n    }\n    _this = _Atom.call(this, name_) || this;\n    _this.enhancer = void 0;\n    _this.name_ = void 0;\n    _this.equals = void 0;\n    _this.hasUnreportedChange_ = false;\n    _this.interceptors_ = void 0;\n    _this.changeListeners_ = void 0;\n    _this.value_ = void 0;\n    _this.dehancer = void 0;\n    _this.enhancer = enhancer;\n    _this.name_ = name_;\n    _this.equals = equals;\n    _this.value_ = enhancer(value, undefined, name_);\n    if (process.env.NODE_ENV !== \"production\" && notifySpy && isSpyEnabled()) {\n      // only notify spy if this is a stand-alone observable\n      spyReport({\n        type: CREATE,\n        object: _assertThisInitialized(_this),\n        observableKind: \"value\",\n        debugObjectName: _this.name_,\n        newValue: \"\" + _this.value_\n      });\n    }\n    return _this;\n  }\n  var _proto = ObservableValue.prototype;\n  _proto.dehanceValue = function dehanceValue(value) {\n    if (this.dehancer !== undefined) {\n      return this.dehancer(value);\n    }\n    return value;\n  };\n  _proto.set = function set(newValue) {\n    var oldValue = this.value_;\n    newValue = this.prepareNewValue_(newValue);\n    if (newValue !== globalState.UNCHANGED) {\n      var notifySpy = isSpyEnabled();\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportStart({\n          type: UPDATE,\n          object: this,\n          observableKind: \"value\",\n          debugObjectName: this.name_,\n          newValue: newValue,\n          oldValue: oldValue\n        });\n      }\n      this.setNewValue_(newValue);\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportEnd();\n      }\n    }\n  };\n  _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n    checkIfStateModificationsAreAllowed(this);\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        object: this,\n        type: UPDATE,\n        newValue: newValue\n      });\n      if (!change) {\n        return globalState.UNCHANGED;\n      }\n      newValue = change.newValue;\n    } // apply modifier\n\n    newValue = this.enhancer(newValue, this.value_, this.name_);\n    return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n  };\n  _proto.setNewValue_ = function setNewValue_(newValue) {\n    var oldValue = this.value_;\n    this.value_ = newValue;\n    this.reportChanged();\n    if (hasListeners(this)) {\n      notifyListeners(this, {\n        type: UPDATE,\n        object: this,\n        newValue: newValue,\n        oldValue: oldValue\n      });\n    }\n  };\n  _proto.get = function get() {\n    this.reportObserved();\n    return this.dehanceValue(this.value_);\n  };\n  _proto.intercept_ = function intercept_(handler) {\n    return registerInterceptor(this, handler);\n  };\n  _proto.observe_ = function observe_(listener, fireImmediately) {\n    if (fireImmediately) {\n      listener({\n        observableKind: \"value\",\n        debugObjectName: this.name_,\n        object: this,\n        type: UPDATE,\n        newValue: this.value_,\n        oldValue: undefined\n      });\n    }\n    return registerListener(this, listener);\n  };\n  _proto.raw = function raw() {\n    // used by MST ot get undehanced value\n    return this.value_;\n  };\n  _proto.toJSON = function toJSON() {\n    return this.get();\n  };\n  _proto.toString = function toString() {\n    return this.name_ + \"[\" + this.value_ + \"]\";\n  };\n  _proto.valueOf = function valueOf() {\n    return toPrimitive(this.get());\n  };\n  _proto[_Symbol$toPrimitive] = function () {\n    return this.valueOf();\n  };\n  return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n *    give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n *    if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n *    go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n  // nodes we are looking at. Our value depends on these nodes\n  // during tracking it's an array with new observed observers\n  // to check for cycles\n  // N.B: unminified as it is used by MST\n\n  /**\r\n   * Create a new computed value based on a function expression.\r\n   *\r\n   * The `name` property is for debug purposes only.\r\n   *\r\n   * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n   * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n   * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n   * Structural comparison can be convenient if you always produce a new aggregated object and\r\n   * don't want to notify observers if it is structurally the same.\r\n   * This is useful for working with vectors, mouse coordinates etc.\r\n   */\n  function ComputedValue(options) {\n    this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n    this.observing_ = [];\n    this.newObserving_ = null;\n    this.isBeingObserved_ = false;\n    this.isPendingUnobservation_ = false;\n    this.observers_ = new Set();\n    this.diffValue_ = 0;\n    this.runId_ = 0;\n    this.lastAccessedBy_ = 0;\n    this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n    this.unboundDepsCount_ = 0;\n    this.value_ = new CaughtException(null);\n    this.name_ = void 0;\n    this.triggeredBy_ = void 0;\n    this.isComputing_ = false;\n    this.isRunningSetter_ = false;\n    this.derivation = void 0;\n    this.setter_ = void 0;\n    this.isTracing_ = TraceMode.NONE;\n    this.scope_ = void 0;\n    this.equals_ = void 0;\n    this.requiresReaction_ = void 0;\n    this.keepAlive_ = void 0;\n    this.onBOL = void 0;\n    this.onBUOL = void 0;\n    if (!options.get) {\n      die(31);\n    }\n    this.derivation = options.get;\n    this.name_ = options.name || (process.env.NODE_ENV !== \"production\" ? \"ComputedValue@\" + getNextId() : \"ComputedValue\");\n    if (options.set) {\n      this.setter_ = createAction(process.env.NODE_ENV !== \"production\" ? this.name_ + \"-setter\" : \"ComputedValue-setter\", options.set);\n    }\n    this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n    this.scope_ = options.context;\n    this.requiresReaction_ = options.requiresReaction;\n    this.keepAlive_ = !!options.keepAlive;\n  }\n  var _proto = ComputedValue.prototype;\n  _proto.onBecomeStale_ = function onBecomeStale_() {\n    propagateMaybeChanged(this);\n  };\n  _proto.onBO = function onBO() {\n    if (this.onBOL) {\n      this.onBOL.forEach(function (listener) {\n        return listener();\n      });\n    }\n  };\n  _proto.onBUO = function onBUO() {\n    if (this.onBUOL) {\n      this.onBUOL.forEach(function (listener) {\n        return listener();\n      });\n    }\n  }\n  /**\r\n   * Returns the current value of this computed value.\r\n   * Will evaluate its computation first if needed.\r\n   */;\n\n  _proto.get = function get() {\n    if (this.isComputing_) {\n      die(32, this.name_, this.derivation);\n    }\n    if (globalState.inBatch === 0 &&\n    // !globalState.trackingDerivatpion &&\n    this.observers_.size === 0 && !this.keepAlive_) {\n      if (shouldCompute(this)) {\n        this.warnAboutUntrackedRead_();\n        startBatch(); // See perf test 'computed memoization'\n\n        this.value_ = this.computeValue_(false);\n        endBatch();\n      }\n    } else {\n      reportObserved(this);\n      if (shouldCompute(this)) {\n        var prevTrackingContext = globalState.trackingContext;\n        if (this.keepAlive_ && !prevTrackingContext) {\n          globalState.trackingContext = this;\n        }\n        if (this.trackAndCompute()) {\n          propagateChangeConfirmed(this);\n        }\n        globalState.trackingContext = prevTrackingContext;\n      }\n    }\n    var result = this.value_;\n    if (isCaughtException(result)) {\n      throw result.cause;\n    }\n    return result;\n  };\n  _proto.set = function set(value) {\n    if (this.setter_) {\n      if (this.isRunningSetter_) {\n        die(33, this.name_);\n      }\n      this.isRunningSetter_ = true;\n      try {\n        this.setter_.call(this.scope_, value);\n      } finally {\n        this.isRunningSetter_ = false;\n      }\n    } else {\n      die(34, this.name_);\n    }\n  };\n  _proto.trackAndCompute = function trackAndCompute() {\n    // N.B: unminified as it is used by MST\n    var oldValue = this.value_;\n    var wasSuspended = /* see #1208 */\n    this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n    var newValue = this.computeValue_(true);\n    var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n    if (changed) {\n      this.value_ = newValue;\n      if (process.env.NODE_ENV !== \"production\" && isSpyEnabled()) {\n        spyReport({\n          observableKind: \"computed\",\n          debugObjectName: this.name_,\n          object: this.scope_,\n          type: \"update\",\n          oldValue: oldValue,\n          newValue: newValue\n        });\n      }\n    }\n    return changed;\n  };\n  _proto.computeValue_ = function computeValue_(track) {\n    this.isComputing_ = true; // don't allow state changes during computation\n\n    var prev = allowStateChangesStart(false);\n    var res;\n    if (track) {\n      res = trackDerivedFunction(this, this.derivation, this.scope_);\n    } else {\n      if (globalState.disableErrorBoundaries === true) {\n        res = this.derivation.call(this.scope_);\n      } else {\n        try {\n          res = this.derivation.call(this.scope_);\n        } catch (e) {\n          res = new CaughtException(e);\n        }\n      }\n    }\n    allowStateChangesEnd(prev);\n    this.isComputing_ = false;\n    return res;\n  };\n  _proto.suspend_ = function suspend_() {\n    if (!this.keepAlive_) {\n      clearObserving(this);\n      this.value_ = undefined; // don't hold on to computed value!\n\n      if (process.env.NODE_ENV !== \"production\" && this.isTracing_ !== TraceMode.NONE) {\n        console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n      }\n    }\n  };\n  _proto.observe_ = function observe_(listener, fireImmediately) {\n    var _this = this;\n    var firstTime = true;\n    var prevValue = undefined;\n    return autorun(function () {\n      // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n      var newValue = _this.get();\n      if (!firstTime || fireImmediately) {\n        var prevU = untrackedStart();\n        listener({\n          observableKind: \"computed\",\n          debugObjectName: _this.name_,\n          type: UPDATE,\n          object: _this,\n          newValue: newValue,\n          oldValue: prevValue\n        });\n        untrackedEnd(prevU);\n      }\n      firstTime = false;\n      prevValue = newValue;\n    });\n  };\n  _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n    if (!(process.env.NODE_ENV !== \"production\")) {\n      return;\n    }\n    if (this.isTracing_ !== TraceMode.NONE) {\n      console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n    }\n    if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n      console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n    }\n  };\n  _proto.toString = function toString() {\n    return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n  };\n  _proto.valueOf = function valueOf() {\n    return toPrimitive(this.get());\n  };\n  _proto[_Symbol$toPrimitive$1] = function () {\n    return this.valueOf();\n  };\n  return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\nvar IDerivationState_;\n(function (IDerivationState_) {\n  // before being run or (outside batch and not being observed)\n  // at this point derivation is not holding any data about dependency tree\n  IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n  // won't recalculate derivation\n  // this is what makes mobx fast\n\n  IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n  // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n  // currently only ComputedValue will propagate POSSIBLY_STALE\n  //\n  // having this state is second big optimization:\n  // don't have to recompute on every dependency change, but only when it's needed\n\n  IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n  // will need to recompute when it's needed next.\n\n  IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n  TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n  TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n  TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n  this.cause = void 0;\n  this.cause = cause; // Empty\n};\n\nfunction isCaughtException(e) {\n  return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n  switch (derivation.dependenciesState_) {\n    case IDerivationState_.UP_TO_DATE_:\n      return false;\n    case IDerivationState_.NOT_TRACKING_:\n    case IDerivationState_.STALE_:\n      return true;\n    case IDerivationState_.POSSIBLY_STALE_:\n      {\n        // state propagation can occur outside of action/reactive context #2195\n        var prevAllowStateReads = allowStateReadsStart(true);\n        var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n        var obs = derivation.observing_,\n          l = obs.length;\n        for (var i = 0; i < l; i++) {\n          var obj = obs[i];\n          if (isComputedValue(obj)) {\n            if (globalState.disableErrorBoundaries) {\n              obj.get();\n            } else {\n              try {\n                obj.get();\n              } catch (e) {\n                // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n                untrackedEnd(prevUntracked);\n                allowStateReadsEnd(prevAllowStateReads);\n                return true;\n              }\n            } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n            // and `derivation` is an observer of `obj`\n            // invariantShouldCompute(derivation)\n\n            if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n              untrackedEnd(prevUntracked);\n              allowStateReadsEnd(prevAllowStateReads);\n              return true;\n            }\n          }\n        }\n        changeDependenciesStateTo0(derivation);\n        untrackedEnd(prevUntracked);\n        allowStateReadsEnd(prevAllowStateReads);\n        return false;\n      }\n  }\n}\nfunction isComputingDerivation() {\n  return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\n\nfunction checkIfStateModificationsAreAllowed(atom) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  }\n  var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n  if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n    console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n  }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n  if (process.env.NODE_ENV !== \"production\" && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n    console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n  }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n  var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n  // array will be trimmed by bindDependencies\n\n  changeDependenciesStateTo0(derivation);\n  derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n  derivation.unboundDepsCount_ = 0;\n  derivation.runId_ = ++globalState.runId;\n  var prevTracking = globalState.trackingDerivation;\n  globalState.trackingDerivation = derivation;\n  globalState.inBatch++;\n  var result;\n  if (globalState.disableErrorBoundaries === true) {\n    result = f.call(context);\n  } else {\n    try {\n      result = f.call(context);\n    } catch (e) {\n      result = new CaughtException(e);\n    }\n  }\n  globalState.inBatch--;\n  globalState.trackingDerivation = prevTracking;\n  bindDependencies(derivation);\n  warnAboutDerivationWithoutDependencies(derivation);\n  allowStateReadsEnd(prevAllowStateReads);\n  return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  }\n  if (derivation.observing_.length !== 0) {\n    return;\n  }\n  if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n    console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n  }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\nfunction bindDependencies(derivation) {\n  // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n  var prevObserving = derivation.observing_;\n  var observing = derivation.observing_ = derivation.newObserving_;\n  var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n  //   0: first occurrence, change to 1 and keep it\n  //   1: extra occurrence, drop it\n\n  var i0 = 0,\n    l = derivation.unboundDepsCount_;\n  for (var i = 0; i < l; i++) {\n    var dep = observing[i];\n    if (dep.diffValue_ === 0) {\n      dep.diffValue_ = 1;\n      if (i0 !== i) {\n        observing[i0] = dep;\n      }\n      i0++;\n    } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n    // not hitting the condition\n\n    if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n      lowestNewObservingDerivationState = dep.dependenciesState_;\n    }\n  }\n  observing.length = i0;\n  derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n  // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n  //   0: it's not in new observables, unobserve it\n  //   1: it keeps being observed, don't want to notify it. change to 0\n\n  l = prevObserving.length;\n  while (l--) {\n    var _dep = prevObserving[l];\n    if (_dep.diffValue_ === 0) {\n      removeObserver(_dep, derivation);\n    }\n    _dep.diffValue_ = 0;\n  } // Go through all new observables and check diffValue: (now it should be unique)\n  //   0: it was set to 0 in last loop. don't need to do anything.\n  //   1: it wasn't observed, let's observe it. set back to 0\n\n  while (i0--) {\n    var _dep2 = observing[i0];\n    if (_dep2.diffValue_ === 1) {\n      _dep2.diffValue_ = 0;\n      addObserver(_dep2, derivation);\n    }\n  } // Some new observed derivations may become stale during this derivation computation\n  // so they have had no chance to propagate staleness (#916)\n\n  if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n    derivation.dependenciesState_ = lowestNewObservingDerivationState;\n    derivation.onBecomeStale_();\n  }\n}\nfunction clearObserving(derivation) {\n  // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n  var obs = derivation.observing_;\n  derivation.observing_ = [];\n  var i = obs.length;\n  while (i--) {\n    removeObserver(obs[i], derivation);\n  }\n  derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n  var prev = untrackedStart();\n  try {\n    return action();\n  } finally {\n    untrackedEnd(prev);\n  }\n}\nfunction untrackedStart() {\n  var prev = globalState.trackingDerivation;\n  globalState.trackingDerivation = null;\n  return prev;\n}\nfunction untrackedEnd(prev) {\n  globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n  var prev = globalState.allowStateReads;\n  globalState.allowStateReads = allowStateReads;\n  return prev;\n}\nfunction allowStateReadsEnd(prev) {\n  globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n  if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n    return;\n  }\n  derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n  var obs = derivation.observing_;\n  var i = obs.length;\n  while (i--) {\n    obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n  }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n  this.version = 6;\n  this.UNCHANGED = {};\n  this.trackingDerivation = null;\n  this.trackingContext = null;\n  this.runId = 0;\n  this.mobxGuid = 0;\n  this.inBatch = 0;\n  this.pendingUnobservations = [];\n  this.pendingReactions = [];\n  this.isRunningReactions = false;\n  this.allowStateChanges = false;\n  this.allowStateReads = true;\n  this.enforceActions = true;\n  this.spyListeners = [];\n  this.globalReactionErrorHandlers = [];\n  this.computedRequiresReaction = false;\n  this.reactionRequiresObservable = false;\n  this.observableRequiresReaction = false;\n  this.disableErrorBoundaries = false;\n  this.suppressReactionErrors = false;\n  this.useProxies = true;\n  this.verifyProxies = false;\n  this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n  var global = /*#__PURE__*/getGlobal();\n  if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n    canMergeGlobalState = false;\n  }\n  if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n    canMergeGlobalState = false;\n  }\n  if (!canMergeGlobalState) {\n    // Because this is a IIFE we need to let isolateCalled a chance to change\n    // so we run it after the event loop completed at least 1 iteration\n    setTimeout(function () {\n      if (!isolateCalled) {\n        die(35);\n      }\n    }, 1);\n    return new MobXGlobals();\n  } else if (global.__mobxGlobals) {\n    global.__mobxInstanceCount += 1;\n    if (!global.__mobxGlobals.UNCHANGED) {\n      global.__mobxGlobals.UNCHANGED = {};\n    } // make merge backward compatible\n\n    return global.__mobxGlobals;\n  } else {\n    global.__mobxInstanceCount = 1;\n    return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n  }\n}();\nfunction isolateGlobalState() {\n  if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n    die(36);\n  }\n  isolateCalled = true;\n  if (canMergeGlobalState) {\n    var global = getGlobal();\n    if (--global.__mobxInstanceCount === 0) {\n      global.__mobxGlobals = undefined;\n    }\n    globalState = new MobXGlobals();\n  }\n}\nfunction getGlobalState() {\n  return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n  var defaultGlobals = new MobXGlobals();\n  for (var key in defaultGlobals) {\n    if (persistentKeys.indexOf(key) === -1) {\n      globalState[key] = defaultGlobals[key];\n    }\n  }\n  globalState.allowStateChanges = !globalState.enforceActions;\n}\nfunction hasObservers(observable) {\n  return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n  return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n//     const list = observable.observers\n//     const map = observable.observersIndexes\n//     const l = list.length\n//     for (let i = 0; i < l; i++) {\n//         const id = list[i].__mapid\n//         if (i) {\n//             invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n//         } else {\n//             invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n//         }\n//     }\n//     invariant(\n//         list.length === 0 || Object.keys(map).length === list.length - 1,\n//         \"INTERNAL ERROR there is no junk in map\"\n//     )\n// }\n\nfunction addObserver(observable, node) {\n  // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n  // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n  // invariantObservers(observable);\n  observable.observers_.add(node);\n  if (observable.lowestObserverState_ > node.dependenciesState_) {\n    observable.lowestObserverState_ = node.dependenciesState_;\n  } // invariantObservers(observable);\n  // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nfunction removeObserver(observable, node) {\n  // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n  // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n  // invariantObservers(observable);\n  observable.observers_[\"delete\"](node);\n  if (observable.observers_.size === 0) {\n    // deleting last observer\n    queueForUnobservation(observable);\n  } // invariantObservers(observable);\n  // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nfunction queueForUnobservation(observable) {\n  if (observable.isPendingUnobservation_ === false) {\n    // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n    observable.isPendingUnobservation_ = true;\n    globalState.pendingUnobservations.push(observable);\n  }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n  globalState.inBatch++;\n}\nfunction endBatch() {\n  if (--globalState.inBatch === 0) {\n    runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n    var list = globalState.pendingUnobservations;\n    for (var i = 0; i < list.length; i++) {\n      var observable = list[i];\n      observable.isPendingUnobservation_ = false;\n      if (observable.observers_.size === 0) {\n        if (observable.isBeingObserved_) {\n          // if this observable had reactive observers, trigger the hooks\n          observable.isBeingObserved_ = false;\n          observable.onBUO();\n        }\n        if (observable instanceof ComputedValue) {\n          // computed values are automatically teared down when the last observer leaves\n          // this process happens recursively, this computed might be the last observabe of another, etc..\n          observable.suspend_();\n        }\n      }\n    }\n    globalState.pendingUnobservations = [];\n  }\n}\nfunction reportObserved(observable) {\n  checkIfStateReadsAreAllowed(observable);\n  var derivation = globalState.trackingDerivation;\n  if (derivation !== null) {\n    /**\r\n     * Simple optimization, give each derivation run an unique id (runId)\r\n     * Check if last time this observable was accessed the same runId is used\r\n     * if this is the case, the relation is already known\r\n     */\n    if (derivation.runId_ !== observable.lastAccessedBy_) {\n      observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n      derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n      if (!observable.isBeingObserved_ && globalState.trackingContext) {\n        observable.isBeingObserved_ = true;\n        observable.onBO();\n      }\n    }\n    return true;\n  } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n    queueForUnobservation(observable);\n  }\n  return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n//     // it's expensive so better not run it in produciton. but temporarily helpful for testing\n//     const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n//     if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n//     throw new Error(\n//         \"lowestObserverState is wrong for \" +\n//             msg +\n//             \" because \" +\n//             min +\n//             \" < \" +\n//             observable.lowestObserverState\n//     )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n  // invariantLOS(observable, \"changed start\");\n  if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n    return;\n  }\n  observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n  observable.observers_.forEach(function (d) {\n    if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n      if (process.env.NODE_ENV !== \"production\" && d.isTracing_ !== TraceMode.NONE) {\n        logTraceInfo(d, observable);\n      }\n      d.onBecomeStale_();\n    }\n    d.dependenciesState_ = IDerivationState_.STALE_;\n  }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n  // invariantLOS(observable, \"confirmed start\");\n  if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n    return;\n  }\n  observable.lowestObserverState_ = IDerivationState_.STALE_;\n  observable.observers_.forEach(function (d) {\n    if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n      d.dependenciesState_ = IDerivationState_.STALE_;\n      if (process.env.NODE_ENV !== \"production\" && d.isTracing_ !== TraceMode.NONE) {\n        logTraceInfo(d, observable);\n      }\n    } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n    ) {\n      observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n    }\n  }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n  // invariantLOS(observable, \"maybe start\");\n  if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n    return;\n  }\n  observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n  observable.observers_.forEach(function (d) {\n    if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n      d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n      d.onBecomeStale_();\n    }\n  }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n  console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n  if (derivation.isTracing_ === TraceMode.BREAK) {\n    var lines = [];\n    printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n    new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n    \")();\n  }\n}\nfunction printDepTree(tree, lines, depth) {\n  if (lines.length >= 1000) {\n    lines.push(\"(and many more)\");\n    return;\n  }\n  lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n  if (tree.dependencies) {\n    tree.dependencies.forEach(function (child) {\n      return printDepTree(child, lines, depth + 1);\n    });\n  }\n}\nvar Reaction = /*#__PURE__*/function () {\n  // nodes we are looking at. Our value depends on these nodes\n  function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n    if (name_ === void 0) {\n      name_ = process.env.NODE_ENV !== \"production\" ? \"Reaction@\" + getNextId() : \"Reaction\";\n    }\n    this.name_ = void 0;\n    this.onInvalidate_ = void 0;\n    this.errorHandler_ = void 0;\n    this.requiresObservable_ = void 0;\n    this.observing_ = [];\n    this.newObserving_ = [];\n    this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n    this.diffValue_ = 0;\n    this.runId_ = 0;\n    this.unboundDepsCount_ = 0;\n    this.isDisposed_ = false;\n    this.isScheduled_ = false;\n    this.isTrackPending_ = false;\n    this.isRunning_ = false;\n    this.isTracing_ = TraceMode.NONE;\n    this.name_ = name_;\n    this.onInvalidate_ = onInvalidate_;\n    this.errorHandler_ = errorHandler_;\n    this.requiresObservable_ = requiresObservable_;\n  }\n  var _proto = Reaction.prototype;\n  _proto.onBecomeStale_ = function onBecomeStale_() {\n    this.schedule_();\n  };\n  _proto.schedule_ = function schedule_() {\n    if (!this.isScheduled_) {\n      this.isScheduled_ = true;\n      globalState.pendingReactions.push(this);\n      runReactions();\n    }\n  };\n  _proto.isScheduled = function isScheduled() {\n    return this.isScheduled_;\n  }\n  /**\r\n   * internal, use schedule() if you intend to kick off a reaction\r\n   */;\n\n  _proto.runReaction_ = function runReaction_() {\n    if (!this.isDisposed_) {\n      startBatch();\n      this.isScheduled_ = false;\n      var prev = globalState.trackingContext;\n      globalState.trackingContext = this;\n      if (shouldCompute(this)) {\n        this.isTrackPending_ = true;\n        try {\n          this.onInvalidate_();\n          if (process.env.NODE_ENV !== \"production\" && this.isTrackPending_ && isSpyEnabled()) {\n            // onInvalidate didn't trigger track right away..\n            spyReport({\n              name: this.name_,\n              type: \"scheduled-reaction\"\n            });\n          }\n        } catch (e) {\n          this.reportExceptionInDerivation_(e);\n        }\n      }\n      globalState.trackingContext = prev;\n      endBatch();\n    }\n  };\n  _proto.track = function track(fn) {\n    if (this.isDisposed_) {\n      return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n    }\n\n    startBatch();\n    var notify = isSpyEnabled();\n    var startTime;\n    if (process.env.NODE_ENV !== \"production\" && notify) {\n      startTime = Date.now();\n      spyReportStart({\n        name: this.name_,\n        type: \"reaction\"\n      });\n    }\n    this.isRunning_ = true;\n    var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n    globalState.trackingContext = this;\n    var result = trackDerivedFunction(this, fn, undefined);\n    globalState.trackingContext = prevReaction;\n    this.isRunning_ = false;\n    this.isTrackPending_ = false;\n    if (this.isDisposed_) {\n      // disposed during last run. Clean up everything that was bound after the dispose call.\n      clearObserving(this);\n    }\n    if (isCaughtException(result)) {\n      this.reportExceptionInDerivation_(result.cause);\n    }\n    if (process.env.NODE_ENV !== \"production\" && notify) {\n      spyReportEnd({\n        time: Date.now() - startTime\n      });\n    }\n    endBatch();\n  };\n  _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n    var _this = this;\n    if (this.errorHandler_) {\n      this.errorHandler_(error, this);\n      return;\n    }\n    if (globalState.disableErrorBoundaries) {\n      throw error;\n    }\n    var message = process.env.NODE_ENV !== \"production\" ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : \"[mobx] uncaught error in '\" + this + \"'\";\n    if (!globalState.suppressReactionErrors) {\n      console.error(message, error);\n      /** If debugging brought you here, please, read the above message :-). Tnx! */\n    } else if (process.env.NODE_ENV !== \"production\") {\n      console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n    } // prettier-ignore\n\n    if (process.env.NODE_ENV !== \"production\" && isSpyEnabled()) {\n      spyReport({\n        type: \"error\",\n        name: this.name_,\n        message: message,\n        error: \"\" + error\n      });\n    }\n    globalState.globalReactionErrorHandlers.forEach(function (f) {\n      return f(error, _this);\n    });\n  };\n  _proto.dispose = function dispose() {\n    if (!this.isDisposed_) {\n      this.isDisposed_ = true;\n      if (!this.isRunning_) {\n        // if disposed while running, clean up later. Maybe not optimal, but rare case\n        startBatch();\n        clearObserving(this);\n        endBatch();\n      }\n    }\n  };\n  _proto.getDisposer_ = function getDisposer_() {\n    var r = this.dispose.bind(this);\n    r[$mobx] = this;\n    return r;\n  };\n  _proto.toString = function toString() {\n    return \"Reaction[\" + this.name_ + \"]\";\n  };\n  _proto.trace = function trace$1(enterBreakPoint) {\n    if (enterBreakPoint === void 0) {\n      enterBreakPoint = false;\n    }\n    trace(this, enterBreakPoint);\n  };\n  return Reaction;\n}();\nfunction onReactionError(handler) {\n  globalState.globalReactionErrorHandlers.push(handler);\n  return function () {\n    var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n    if (idx >= 0) {\n      globalState.globalReactionErrorHandlers.splice(idx, 1);\n    }\n  };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n  return f();\n};\nfunction runReactions() {\n  // Trampolining, if runReactions are already running, new reactions will be picked up\n  if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n    return;\n  }\n  reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n  globalState.isRunningReactions = true;\n  var allReactions = globalState.pendingReactions;\n  var iterations = 0; // While running reactions, new reactions might be triggered.\n  // Hence we work with two variables and check whether\n  // we converge to no remaining reactions after a while.\n\n  while (allReactions.length > 0) {\n    if (++iterations === MAX_REACTION_ITERATIONS) {\n      console.error(process.env.NODE_ENV !== \"production\" ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : \"[mobx] cycle in reaction: \" + allReactions[0]);\n      allReactions.splice(0); // clear reactions\n    }\n\n    var remainingReactions = allReactions.splice(0);\n    for (var i = 0, l = remainingReactions.length; i < l; i++) {\n      remainingReactions[i].runReaction_();\n    }\n  }\n  globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n  var baseScheduler = reactionScheduler;\n  reactionScheduler = function reactionScheduler(f) {\n    return fn(function () {\n      return baseScheduler(f);\n    });\n  };\n}\nfunction isSpyEnabled() {\n  return process.env.NODE_ENV !== \"production\" && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  } // dead code elimination can do the rest\n\n  if (!globalState.spyListeners.length) {\n    return;\n  }\n  var listeners = globalState.spyListeners;\n  for (var i = 0, l = listeners.length; i < l; i++) {\n    listeners[i](event);\n  }\n}\nfunction spyReportStart(event) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  }\n  var change = _extends({}, event, {\n    spyReportStart: true\n  });\n  spyReport(change);\n}\nvar END_EVENT = {\n  type: \"report-end\",\n  spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  }\n  if (change) {\n    spyReport(_extends({}, change, {\n      type: \"report-end\",\n      spyReportEnd: true\n    }));\n  } else {\n    spyReport(END_EVENT);\n  }\n}\nfunction spy(listener) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    console.warn(\"[mobx.spy] Is a no-op in production builds\");\n    return function () {};\n  } else {\n    globalState.spyListeners.push(listener);\n    return once(function () {\n      globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n        return l !== listener;\n      });\n    });\n  }\n}\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"<unnamed action>\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n  bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n  autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n  autoAction: true,\n  bound: true\n});\nfunction createActionFactory(autoAction) {\n  var res = function action(arg1, arg2) {\n    // action(fn() {})\n    if (isFunction(arg1)) {\n      return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n    } // action(\"name\", fn() {})\n\n    if (isFunction(arg2)) {\n      return createAction(arg1, arg2, autoAction);\n    } // @action\n\n    if (isStringish(arg2)) {\n      return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n    } // action(\"name\") & @action(\"name\")\n\n    if (isStringish(arg1)) {\n      return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n        name: arg1,\n        autoAction: autoAction\n      }));\n    }\n    if (process.env.NODE_ENV !== \"production\") {\n      die(\"Invalid arguments for `action`\");\n    }\n  };\n  return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n  return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n  return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n  var _opts$name, _opts;\n  if (opts === void 0) {\n    opts = EMPTY_OBJECT;\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isFunction(view)) {\n      die(\"Autorun expects a function as first argument\");\n    }\n    if (isAction(view)) {\n      die(\"Autorun does not accept actions since actions are untrackable\");\n    }\n  }\n  var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : process.env.NODE_ENV !== \"production\" ? view.name || \"Autorun@\" + getNextId() : \"Autorun\";\n  var runSync = !opts.scheduler && !opts.delay;\n  var reaction;\n  if (runSync) {\n    // normal autorun\n    reaction = new Reaction(name, function () {\n      this.track(reactionRunner);\n    }, opts.onError, opts.requiresObservable);\n  } else {\n    var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n    var isScheduled = false;\n    reaction = new Reaction(name, function () {\n      if (!isScheduled) {\n        isScheduled = true;\n        scheduler(function () {\n          isScheduled = false;\n          if (!reaction.isDisposed_) {\n            reaction.track(reactionRunner);\n          }\n        });\n      }\n    }, opts.onError, opts.requiresObservable);\n  }\n  function reactionRunner() {\n    view(reaction);\n  }\n  reaction.schedule_();\n  return reaction.getDisposer_();\n}\nvar run = function run(f) {\n  return f();\n};\nfunction createSchedulerFromOptions(opts) {\n  return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n    return setTimeout(f, opts.delay);\n  } : run;\n}\nfunction reaction(expression, effect, opts) {\n  var _opts$name2;\n  if (opts === void 0) {\n    opts = EMPTY_OBJECT;\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isFunction(expression) || !isFunction(effect)) {\n      die(\"First and second argument to reaction should be functions\");\n    }\n    if (!isPlainObject(opts)) {\n      die(\"Third argument of reactions should be an object\");\n    }\n  }\n  var name = (_opts$name2 = opts.name) != null ? _opts$name2 : process.env.NODE_ENV !== \"production\" ? \"Reaction@\" + getNextId() : \"Reaction\";\n  var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n  var runSync = !opts.scheduler && !opts.delay;\n  var scheduler = createSchedulerFromOptions(opts);\n  var firstTime = true;\n  var isScheduled = false;\n  var value;\n  var oldValue;\n  var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n  var r = new Reaction(name, function () {\n    if (firstTime || runSync) {\n      reactionRunner();\n    } else if (!isScheduled) {\n      isScheduled = true;\n      scheduler(reactionRunner);\n    }\n  }, opts.onError, opts.requiresObservable);\n  function reactionRunner() {\n    isScheduled = false;\n    if (r.isDisposed_) {\n      return;\n    }\n    var changed = false;\n    r.track(function () {\n      var nextValue = allowStateChanges(false, function () {\n        return expression(r);\n      });\n      changed = firstTime || !equals(value, nextValue);\n      oldValue = value;\n      value = nextValue;\n    });\n    if (firstTime && opts.fireImmediately) {\n      effectAction(value, oldValue, r);\n    } else if (!firstTime && changed) {\n      effectAction(value, oldValue, r);\n    }\n    firstTime = false;\n  }\n  r.schedule_();\n  return r.getDisposer_();\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n  return function () {\n    try {\n      return baseFn.apply(this, arguments);\n    } catch (e) {\n      errorHandler.call(this, e);\n    }\n  };\n}\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n  return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n  return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n  var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n  var cb = isFunction(arg3) ? arg3 : arg2;\n  var listenersKey = hook + \"L\";\n  if (atom[listenersKey]) {\n    atom[listenersKey].add(cb);\n  } else {\n    atom[listenersKey] = new Set([cb]);\n  }\n  return function () {\n    var hookListeners = atom[listenersKey];\n    if (hookListeners) {\n      hookListeners[\"delete\"](cb);\n      if (hookListeners.size === 0) {\n        delete atom[listenersKey];\n      }\n    }\n  };\n}\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n  if (options.isolateGlobalState === true) {\n    isolateGlobalState();\n  }\n  var useProxies = options.useProxies,\n    enforceActions = options.enforceActions;\n  if (useProxies !== undefined) {\n    globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n  }\n  if (useProxies === \"ifavailable\") {\n    globalState.verifyProxies = true;\n  }\n  if (enforceActions !== undefined) {\n    var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n    globalState.enforceActions = ea;\n    globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n  }\n  [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n    if (key in options) {\n      globalState[key] = !!options[key];\n    }\n  });\n  globalState.allowStateReads = !globalState.observableRequiresReaction;\n  if (process.env.NODE_ENV !== \"production\" && globalState.disableErrorBoundaries === true) {\n    console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n  }\n  if (options.reactionScheduler) {\n    setReactionScheduler(options.reactionScheduler);\n  }\n}\nfunction extendObservable(target, properties, annotations, options) {\n  if (process.env.NODE_ENV !== \"production\") {\n    if (arguments.length > 4) {\n      die(\"'extendObservable' expected 2-4 arguments\");\n    }\n    if (typeof target !== \"object\") {\n      die(\"'extendObservable' expects an object as first argument\");\n    }\n    if (isObservableMap(target)) {\n      die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n    }\n    if (!isPlainObject(properties)) {\n      die(\"'extendObservable' only accepts plain objects as second argument\");\n    }\n    if (isObservable(properties) || isObservable(annotations)) {\n      die(\"Extending an object with another observable (object) is not supported\");\n    }\n  } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n  var descriptors = getOwnPropertyDescriptors(properties);\n  var adm = asObservableObject(target, options)[$mobx];\n  startBatch();\n  try {\n    ownKeys(descriptors).forEach(function (key) {\n      adm.extend_(key, descriptors[key],\n      // must pass \"undefined\" for { key: undefined }\n      !annotations ? true : key in annotations ? annotations[key] : true);\n    });\n  } finally {\n    endBatch();\n  }\n  return target;\n}\nfunction getDependencyTree(thing, property) {\n  return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n  var result = {\n    name: node.name_\n  };\n  if (node.observing_ && node.observing_.length > 0) {\n    result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n  }\n  return result;\n}\nfunction getObserverTree(thing, property) {\n  return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n  var result = {\n    name: node.name_\n  };\n  if (hasObservers(node)) {\n    result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n  }\n  return result;\n}\nfunction unique(list) {\n  return Array.from(new Set(list));\n}\nvar generatorId = 0;\nfunction FlowCancellationError() {\n  this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n  return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n  bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n  // @flow\n  if (isStringish(arg2)) {\n    return storeAnnotation(arg1, arg2, flowAnnotation);\n  } // flow(fn)\n\n  if (process.env.NODE_ENV !== \"production\" && arguments.length !== 1) {\n    die(\"Flow expects single argument with generator function\");\n  }\n  var generator = arg1;\n  var name = generator.name || \"<unnamed flow>\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n  var res = function res() {\n    var ctx = this;\n    var args = arguments;\n    var runId = ++generatorId;\n    var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n    var rejector;\n    var pendingPromise = undefined;\n    var promise = new Promise(function (resolve, reject) {\n      var stepId = 0;\n      rejector = reject;\n      function onFulfilled(res) {\n        pendingPromise = undefined;\n        var ret;\n        try {\n          ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n        } catch (e) {\n          return reject(e);\n        }\n        next(ret);\n      }\n      function onRejected(err) {\n        pendingPromise = undefined;\n        var ret;\n        try {\n          ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n        } catch (e) {\n          return reject(e);\n        }\n        next(ret);\n      }\n      function next(ret) {\n        if (isFunction(ret == null ? void 0 : ret.then)) {\n          // an async iterator\n          ret.then(next, reject);\n          return;\n        }\n        if (ret.done) {\n          return resolve(ret.value);\n        }\n        pendingPromise = Promise.resolve(ret.value);\n        return pendingPromise.then(onFulfilled, onRejected);\n      }\n      onFulfilled(undefined); // kick off the process\n    });\n\n    promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n      try {\n        if (pendingPromise) {\n          cancelPromise(pendingPromise);\n        } // Finally block can return (or yield) stuff..\n\n        var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n        var yieldedPromise = Promise.resolve(_res.value);\n        yieldedPromise.then(noop, noop);\n        cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n        // reject our original promise\n\n        rejector(new FlowCancellationError());\n      } catch (e) {\n        rejector(e); // there could be a throwing finally block\n      }\n    });\n\n    return promise;\n  };\n  res.isMobXFlow = true;\n  return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n  if (isFunction(promise.cancel)) {\n    promise.cancel();\n  }\n}\nfunction flowResult(result) {\n  return result; // just tricking TypeScript :)\n}\n\nfunction isFlow(fn) {\n  return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\nfunction interceptReads(thing, propOrHandler, handler) {\n  var target;\n  if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n    target = getAdministration(thing);\n  } else if (isObservableObject(thing)) {\n    if (process.env.NODE_ENV !== \"production\" && !isStringish(propOrHandler)) {\n      return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n    }\n    target = getAdministration(thing, propOrHandler);\n  } else if (process.env.NODE_ENV !== \"production\") {\n    return die(\"Expected observable map, object or array as first array\");\n  }\n  if (process.env.NODE_ENV !== \"production\" && target.dehancer !== undefined) {\n    return die(\"An intercept reader was already established\");\n  }\n  target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n  return function () {\n    target.dehancer = undefined;\n  };\n}\nfunction intercept(thing, propOrHandler, handler) {\n  if (isFunction(handler)) {\n    return interceptProperty(thing, propOrHandler, handler);\n  } else {\n    return interceptInterceptable(thing, propOrHandler);\n  }\n}\nfunction interceptInterceptable(thing, handler) {\n  return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n  return getAdministration(thing, property).intercept_(handler);\n}\nfunction _isComputed(value, property) {\n  if (property === undefined) {\n    return isComputedValue(value);\n  }\n  if (isObservableObject(value) === false) {\n    return false;\n  }\n  if (!value[$mobx].values_.has(property)) {\n    return false;\n  }\n  var atom = getAtom(value, property);\n  return isComputedValue(atom);\n}\nfunction isComputed(value) {\n  if (process.env.NODE_ENV !== \"production\" && arguments.length > 1) {\n    return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n  }\n  return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n  if (process.env.NODE_ENV !== \"production\" && !isStringish(propName)) {\n    return die(\"isComputed expected a property name as second argument\");\n  }\n  return _isComputed(value, propName);\n}\nfunction _isObservable(value, property) {\n  if (!value) {\n    return false;\n  }\n  if (property !== undefined) {\n    if (process.env.NODE_ENV !== \"production\" && (isObservableMap(value) || isObservableArray(value))) {\n      return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n    }\n    if (isObservableObject(value)) {\n      return value[$mobx].values_.has(property);\n    }\n    return false;\n  } // For first check, see #701\n\n  return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n  if (process.env.NODE_ENV !== \"production\" && arguments.length !== 1) {\n    die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n  }\n  return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n  if (process.env.NODE_ENV !== \"production\" && !isStringish(propName)) {\n    return die(\"expected a property name as second argument\");\n  }\n  return _isObservable(value, propName);\n}\nfunction keys(obj) {\n  if (isObservableObject(obj)) {\n    return obj[$mobx].keys_();\n  }\n  if (isObservableMap(obj) || isObservableSet(obj)) {\n    return Array.from(obj.keys());\n  }\n  if (isObservableArray(obj)) {\n    return obj.map(function (_, index) {\n      return index;\n    });\n  }\n  die(5);\n}\nfunction values(obj) {\n  if (isObservableObject(obj)) {\n    return keys(obj).map(function (key) {\n      return obj[key];\n    });\n  }\n  if (isObservableMap(obj)) {\n    return keys(obj).map(function (key) {\n      return obj.get(key);\n    });\n  }\n  if (isObservableSet(obj)) {\n    return Array.from(obj.values());\n  }\n  if (isObservableArray(obj)) {\n    return obj.slice();\n  }\n  die(6);\n}\nfunction entries(obj) {\n  if (isObservableObject(obj)) {\n    return keys(obj).map(function (key) {\n      return [key, obj[key]];\n    });\n  }\n  if (isObservableMap(obj)) {\n    return keys(obj).map(function (key) {\n      return [key, obj.get(key)];\n    });\n  }\n  if (isObservableSet(obj)) {\n    return Array.from(obj.entries());\n  }\n  if (isObservableArray(obj)) {\n    return obj.map(function (key, index) {\n      return [index, key];\n    });\n  }\n  die(7);\n}\nfunction set(obj, key, value) {\n  if (arguments.length === 2 && !isObservableSet(obj)) {\n    startBatch();\n    var _values = key;\n    try {\n      for (var _key in _values) {\n        set(obj, _key, _values[_key]);\n      }\n    } finally {\n      endBatch();\n    }\n    return;\n  }\n  if (isObservableObject(obj)) {\n    obj[$mobx].set_(key, value);\n  } else if (isObservableMap(obj)) {\n    obj.set(key, value);\n  } else if (isObservableSet(obj)) {\n    obj.add(key);\n  } else if (isObservableArray(obj)) {\n    if (typeof key !== \"number\") {\n      key = parseInt(key, 10);\n    }\n    if (key < 0) {\n      die(\"Invalid index: '\" + key + \"'\");\n    }\n    startBatch();\n    if (key >= obj.length) {\n      obj.length = key + 1;\n    }\n    obj[key] = value;\n    endBatch();\n  } else {\n    die(8);\n  }\n}\nfunction remove(obj, key) {\n  if (isObservableObject(obj)) {\n    obj[$mobx].delete_(key);\n  } else if (isObservableMap(obj)) {\n    obj[\"delete\"](key);\n  } else if (isObservableSet(obj)) {\n    obj[\"delete\"](key);\n  } else if (isObservableArray(obj)) {\n    if (typeof key !== \"number\") {\n      key = parseInt(key, 10);\n    }\n    obj.splice(key, 1);\n  } else {\n    die(9);\n  }\n}\nfunction has(obj, key) {\n  if (isObservableObject(obj)) {\n    return obj[$mobx].has_(key);\n  } else if (isObservableMap(obj)) {\n    return obj.has(key);\n  } else if (isObservableSet(obj)) {\n    return obj.has(key);\n  } else if (isObservableArray(obj)) {\n    return key >= 0 && key < obj.length;\n  }\n  die(10);\n}\nfunction get(obj, key) {\n  if (!has(obj, key)) {\n    return undefined;\n  }\n  if (isObservableObject(obj)) {\n    return obj[$mobx].get_(key);\n  } else if (isObservableMap(obj)) {\n    return obj.get(key);\n  } else if (isObservableArray(obj)) {\n    return obj[key];\n  }\n  die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n  if (isObservableObject(obj)) {\n    return obj[$mobx].defineProperty_(key, descriptor);\n  }\n  die(39);\n}\nfunction apiOwnKeys(obj) {\n  if (isObservableObject(obj)) {\n    return obj[$mobx].ownKeys_();\n  }\n  die(38);\n}\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n  if (isFunction(cbOrFire)) {\n    return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n  } else {\n    return observeObservable(thing, propOrCb, cbOrFire);\n  }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n  return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n  return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\nfunction cache(map, key, value) {\n  map.set(key, value);\n  return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n  if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n    return source;\n  }\n  if (isObservableValue(source) || isComputedValue(source)) {\n    return toJSHelper(source.get(), __alreadySeen);\n  }\n  if (__alreadySeen.has(source)) {\n    return __alreadySeen.get(source);\n  }\n  if (isObservableArray(source)) {\n    var res = cache(__alreadySeen, source, new Array(source.length));\n    source.forEach(function (value, idx) {\n      res[idx] = toJSHelper(value, __alreadySeen);\n    });\n    return res;\n  }\n  if (isObservableSet(source)) {\n    var _res = cache(__alreadySeen, source, new Set());\n    source.forEach(function (value) {\n      _res.add(toJSHelper(value, __alreadySeen));\n    });\n    return _res;\n  }\n  if (isObservableMap(source)) {\n    var _res2 = cache(__alreadySeen, source, new Map());\n    source.forEach(function (value, key) {\n      _res2.set(key, toJSHelper(value, __alreadySeen));\n    });\n    return _res2;\n  } else {\n    // must be observable object\n    var _res3 = cache(__alreadySeen, source, {});\n    apiOwnKeys(source).forEach(function (key) {\n      if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n        _res3[key] = toJSHelper(source[key], __alreadySeen);\n      }\n    });\n    return _res3;\n  }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\n\nfunction toJS(source, options) {\n  if (process.env.NODE_ENV !== \"production\" && options) {\n    die(\"toJS no longer supports options\");\n  }\n  return toJSHelper(source, new Map());\n}\nfunction trace() {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    die(\"trace() is not available in production builds\");\n  }\n  var enterBreakPoint = false;\n  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n    args[_key] = arguments[_key];\n  }\n  if (typeof args[args.length - 1] === \"boolean\") {\n    enterBreakPoint = args.pop();\n  }\n  var derivation = getAtomFromArgs(args);\n  if (!derivation) {\n    return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n  }\n  if (derivation.isTracing_ === TraceMode.NONE) {\n    console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n  }\n  derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n  switch (args.length) {\n    case 0:\n      return globalState.trackingDerivation;\n    case 1:\n      return getAtom(args[0]);\n    case 2:\n      return getAtom(args[0], args[1]);\n  }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n  if (thisArg === void 0) {\n    thisArg = undefined;\n  }\n  startBatch();\n  try {\n    return action.apply(thisArg);\n  } finally {\n    endBatch();\n  }\n}\nfunction when(predicate, arg1, arg2) {\n  if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n    return whenPromise(predicate, arg1);\n  }\n  return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n  var timeoutHandle;\n  if (typeof opts.timeout === \"number\") {\n    var error = new Error(\"WHEN_TIMEOUT\");\n    timeoutHandle = setTimeout(function () {\n      if (!disposer[$mobx].isDisposed_) {\n        disposer();\n        if (opts.onError) {\n          opts.onError(error);\n        } else {\n          throw error;\n        }\n      }\n    }, opts.timeout);\n  }\n  opts.name = process.env.NODE_ENV !== \"production\" ? opts.name || \"When@\" + getNextId() : \"When\";\n  var effectAction = createAction(process.env.NODE_ENV !== \"production\" ? opts.name + \"-effect\" : \"When-effect\", effect); // eslint-disable-next-line\n\n  var disposer = autorun(function (r) {\n    // predicate should not change state\n    var cond = allowStateChanges(false, predicate);\n    if (cond) {\n      r.dispose();\n      if (timeoutHandle) {\n        clearTimeout(timeoutHandle);\n      }\n      effectAction();\n    }\n  }, opts);\n  return disposer;\n}\nfunction whenPromise(predicate, opts) {\n  if (process.env.NODE_ENV !== \"production\" && opts && opts.onError) {\n    return die(\"the options 'onError' and 'promise' cannot be combined\");\n  }\n  var cancel;\n  var res = new Promise(function (resolve, reject) {\n    var disposer = _when(predicate, resolve, _extends({}, opts, {\n      onError: reject\n    }));\n    cancel = function cancel() {\n      disposer();\n      reject(new Error(\"WHEN_CANCELLED\"));\n    };\n  });\n  res.cancel = cancel;\n  return res;\n}\nfunction getAdm(target) {\n  return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\nvar objectProxyTraps = {\n  has: function has(target, name) {\n    if (process.env.NODE_ENV !== \"production\" && globalState.trackingDerivation) {\n      warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n    }\n    return getAdm(target).has_(name);\n  },\n  get: function get(target, name) {\n    return getAdm(target).get_(name);\n  },\n  set: function set(target, name, value) {\n    var _getAdm$set_;\n    if (!isStringish(name)) {\n      return false;\n    }\n    if (process.env.NODE_ENV !== \"production\" && !getAdm(target).values_.has(name)) {\n      warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n    } // null (intercepted) -> true (success)\n\n    return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n  },\n  deleteProperty: function deleteProperty(target, name) {\n    var _getAdm$delete_;\n    if (process.env.NODE_ENV !== \"production\") {\n      warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n    }\n    if (!isStringish(name)) {\n      return false;\n    } // null (intercepted) -> true (success)\n\n    return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n  },\n  defineProperty: function defineProperty(target, name, descriptor) {\n    var _getAdm$definePropert;\n    if (process.env.NODE_ENV !== \"production\") {\n      warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n    } // null (intercepted) -> true (success)\n\n    return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n  },\n  ownKeys: function ownKeys(target) {\n    if (process.env.NODE_ENV !== \"production\" && globalState.trackingDerivation) {\n      warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n    }\n    return getAdm(target).ownKeys_();\n  },\n  preventExtensions: function preventExtensions(target) {\n    die(13);\n  }\n};\nfunction asDynamicObservableObject(target, options) {\n  var _target$$mobx, _target$$mobx$proxy_;\n  assertProxies();\n  target = asObservableObject(target, options);\n  return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\nfunction hasInterceptors(interceptable) {\n  return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n  var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n  interceptors.push(handler);\n  return once(function () {\n    var idx = interceptors.indexOf(handler);\n    if (idx !== -1) {\n      interceptors.splice(idx, 1);\n    }\n  });\n}\nfunction interceptChange(interceptable, change) {\n  var prevU = untrackedStart();\n  try {\n    // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n    var interceptors = [].concat(interceptable.interceptors_ || []);\n    for (var i = 0, l = interceptors.length; i < l; i++) {\n      change = interceptors[i](change);\n      if (change && !change.type) {\n        die(14);\n      }\n      if (!change) {\n        break;\n      }\n    }\n    return change;\n  } finally {\n    untrackedEnd(prevU);\n  }\n}\nfunction hasListeners(listenable) {\n  return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n  var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n  listeners.push(handler);\n  return once(function () {\n    var idx = listeners.indexOf(handler);\n    if (idx !== -1) {\n      listeners.splice(idx, 1);\n    }\n  });\n}\nfunction notifyListeners(listenable, change) {\n  var prevU = untrackedStart();\n  var listeners = listenable.changeListeners_;\n  if (!listeners) {\n    return;\n  }\n  listeners = listeners.slice();\n  for (var i = 0, l = listeners.length; i < l; i++) {\n    listeners[i](change);\n  }\n  untrackedEnd(prevU);\n}\nfunction makeObservable(target, annotations, options) {\n  var adm = asObservableObject(target, options)[$mobx];\n  startBatch();\n  try {\n    var _annotations;\n    if (process.env.NODE_ENV !== \"production\" && annotations && target[storedAnnotationsSymbol]) {\n      die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n    } // Default to decorators\n\n    (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n    ownKeys(annotations).forEach(function (key) {\n      return adm.make_(key, annotations[key]);\n    });\n  } finally {\n    endBatch();\n  }\n  return target;\n} // proto[keysSymbol] = new Set<PropertyKey>()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n      die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n    }\n    if (isObservableObject(target)) {\n      die(\"makeAutoObservable can only be used on objects not already made observable\");\n    }\n  } // Optimization: avoid visiting protos\n  // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n  if (isPlainObject(target)) {\n    return extendObservable(target, target, overrides, options);\n  }\n  var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n  // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n  if (!target[keysSymbol]) {\n    var proto = Object.getPrototypeOf(target);\n    var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n    keys[\"delete\"](\"constructor\");\n    keys[\"delete\"]($mobx);\n    addHiddenProp(proto, keysSymbol, keys);\n  }\n  startBatch();\n  try {\n    target[keysSymbol].forEach(function (key) {\n      return adm.make_(key,\n      // must pass \"undefined\" for { key: undefined }\n      !overrides ? true : key in overrides ? overrides[key] : true);\n    });\n  } finally {\n    endBatch();\n  }\n  return target;\n}\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n  get: function get(target, name) {\n    var adm = target[$mobx];\n    if (name === $mobx) {\n      return adm;\n    }\n    if (name === \"length\") {\n      return adm.getArrayLength_();\n    }\n    if (typeof name === \"string\" && !isNaN(name)) {\n      return adm.get_(parseInt(name));\n    }\n    if (hasProp(arrayExtensions, name)) {\n      return arrayExtensions[name];\n    }\n    return target[name];\n  },\n  set: function set(target, name, value) {\n    var adm = target[$mobx];\n    if (name === \"length\") {\n      adm.setArrayLength_(value);\n    }\n    if (typeof name === \"symbol\" || isNaN(name)) {\n      target[name] = value;\n    } else {\n      // numeric string\n      adm.set_(parseInt(name), value);\n    }\n    return true;\n  },\n  preventExtensions: function preventExtensions() {\n    die(15);\n  }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n  // this is the prop that gets proxied, so can't replace it!\n  function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n    if (name === void 0) {\n      name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n    }\n    this.owned_ = void 0;\n    this.legacyMode_ = void 0;\n    this.atom_ = void 0;\n    this.values_ = [];\n    this.interceptors_ = void 0;\n    this.changeListeners_ = void 0;\n    this.enhancer_ = void 0;\n    this.dehancer = void 0;\n    this.proxy_ = void 0;\n    this.lastKnownLength_ = 0;\n    this.owned_ = owned_;\n    this.legacyMode_ = legacyMode_;\n    this.atom_ = new Atom(name);\n    this.enhancer_ = function (newV, oldV) {\n      return enhancer(newV, oldV, process.env.NODE_ENV !== \"production\" ? name + \"[..]\" : \"ObservableArray[..]\");\n    };\n  }\n  var _proto = ObservableArrayAdministration.prototype;\n  _proto.dehanceValue_ = function dehanceValue_(value) {\n    if (this.dehancer !== undefined) {\n      return this.dehancer(value);\n    }\n    return value;\n  };\n  _proto.dehanceValues_ = function dehanceValues_(values) {\n    if (this.dehancer !== undefined && values.length > 0) {\n      return values.map(this.dehancer);\n    }\n    return values;\n  };\n  _proto.intercept_ = function intercept_(handler) {\n    return registerInterceptor(this, handler);\n  };\n  _proto.observe_ = function observe_(listener, fireImmediately) {\n    if (fireImmediately === void 0) {\n      fireImmediately = false;\n    }\n    if (fireImmediately) {\n      listener({\n        observableKind: \"array\",\n        object: this.proxy_,\n        debugObjectName: this.atom_.name_,\n        type: \"splice\",\n        index: 0,\n        added: this.values_.slice(),\n        addedCount: this.values_.length,\n        removed: [],\n        removedCount: 0\n      });\n    }\n    return registerListener(this, listener);\n  };\n  _proto.getArrayLength_ = function getArrayLength_() {\n    this.atom_.reportObserved();\n    return this.values_.length;\n  };\n  _proto.setArrayLength_ = function setArrayLength_(newLength) {\n    if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n      die(\"Out of range: \" + newLength);\n    }\n    var currentLength = this.values_.length;\n    if (newLength === currentLength) {\n      return;\n    } else if (newLength > currentLength) {\n      var newItems = new Array(newLength - currentLength);\n      for (var i = 0; i < newLength - currentLength; i++) {\n        newItems[i] = undefined;\n      } // No Array.fill everywhere...\n\n      this.spliceWithArray_(currentLength, 0, newItems);\n    } else {\n      this.spliceWithArray_(newLength, currentLength - newLength);\n    }\n  };\n  _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n    if (oldLength !== this.lastKnownLength_) {\n      die(16);\n    }\n    this.lastKnownLength_ += delta;\n    if (this.legacyMode_ && delta > 0) {\n      reserveArrayBuffer(oldLength + delta + 1);\n    }\n  };\n  _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n    var _this = this;\n    checkIfStateModificationsAreAllowed(this.atom_);\n    var length = this.values_.length;\n    if (index === undefined) {\n      index = 0;\n    } else if (index > length) {\n      index = length;\n    } else if (index < 0) {\n      index = Math.max(0, length + index);\n    }\n    if (arguments.length === 1) {\n      deleteCount = length - index;\n    } else if (deleteCount === undefined || deleteCount === null) {\n      deleteCount = 0;\n    } else {\n      deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n    }\n    if (newItems === undefined) {\n      newItems = EMPTY_ARRAY;\n    }\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        object: this.proxy_,\n        type: SPLICE,\n        index: index,\n        removedCount: deleteCount,\n        added: newItems\n      });\n      if (!change) {\n        return EMPTY_ARRAY;\n      }\n      deleteCount = change.removedCount;\n      newItems = change.added;\n    }\n    newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n      return _this.enhancer_(v, undefined);\n    });\n    if (this.legacyMode_ || process.env.NODE_ENV !== \"production\") {\n      var lengthDelta = newItems.length - deleteCount;\n      this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n    }\n\n    var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n    if (deleteCount !== 0 || newItems.length !== 0) {\n      this.notifyArraySplice_(index, newItems, res);\n    }\n    return this.dehanceValues_(res);\n  };\n  _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n    if (newItems.length < MAX_SPLICE_SIZE) {\n      var _this$values_;\n      return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n    } else {\n      // The items removed by the splice\n      var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array\n\n      var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count\n\n      this.values_.length += newItems.length - deleteCount;\n      for (var i = 0; i < newItems.length; i++) {\n        this.values_[index + i] = newItems[i];\n      }\n      for (var _i = 0; _i < oldItems.length; _i++) {\n        this.values_[index + newItems.length + _i] = oldItems[_i];\n      }\n      return res;\n    }\n  };\n  _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n    var notifySpy = !this.owned_ && isSpyEnabled();\n    var notify = hasListeners(this);\n    var change = notify || notifySpy ? {\n      observableKind: \"array\",\n      object: this.proxy_,\n      type: UPDATE,\n      debugObjectName: this.atom_.name_,\n      index: index,\n      newValue: newValue,\n      oldValue: oldValue\n    } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n    // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportStart(change);\n    }\n    this.atom_.reportChanged();\n    if (notify) {\n      notifyListeners(this, change);\n    }\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportEnd();\n    }\n  };\n  _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n    var notifySpy = !this.owned_ && isSpyEnabled();\n    var notify = hasListeners(this);\n    var change = notify || notifySpy ? {\n      observableKind: \"array\",\n      object: this.proxy_,\n      debugObjectName: this.atom_.name_,\n      type: SPLICE,\n      index: index,\n      removed: removed,\n      added: added,\n      removedCount: removed.length,\n      addedCount: added.length\n    } : null;\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportStart(change);\n    }\n    this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n    if (notify) {\n      notifyListeners(this, change);\n    }\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportEnd();\n    }\n  };\n  _proto.get_ = function get_(index) {\n    if (index < this.values_.length) {\n      this.atom_.reportObserved();\n      return this.dehanceValue_(this.values_[index]);\n    }\n    console.warn(process.env.NODE_ENV !== \"production\" ? \"[mobx] Out of bounds read: \" + index : \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\");\n  };\n  _proto.set_ = function set_(index, newValue) {\n    var values = this.values_;\n    if (index < values.length) {\n      // update at index in range\n      checkIfStateModificationsAreAllowed(this.atom_);\n      var oldValue = values[index];\n      if (hasInterceptors(this)) {\n        var change = interceptChange(this, {\n          type: UPDATE,\n          object: this.proxy_,\n          index: index,\n          newValue: newValue\n        });\n        if (!change) {\n          return;\n        }\n        newValue = change.newValue;\n      }\n      newValue = this.enhancer_(newValue, oldValue);\n      var changed = newValue !== oldValue;\n      if (changed) {\n        values[index] = newValue;\n        this.notifyArrayChildUpdate_(index, newValue, oldValue);\n      }\n    } else if (index === values.length) {\n      // add a new item\n      this.spliceWithArray_(index, 0, [newValue]);\n    } else {\n      // out of bounds\n      die(17, index, values.length);\n    }\n  };\n  return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n  if (name === void 0) {\n    name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n  }\n  if (owned === void 0) {\n    owned = false;\n  }\n  assertProxies();\n  var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n  addHiddenFinalProp(adm.values_, $mobx, adm);\n  var proxy = new Proxy(adm.values_, arrayTraps);\n  adm.proxy_ = proxy;\n  if (initialValues && initialValues.length) {\n    var prev = allowStateChangesStart(true);\n    adm.spliceWithArray_(0, 0, initialValues);\n    allowStateChangesEnd(prev);\n  }\n  return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n  clear: function clear() {\n    return this.splice(0);\n  },\n  replace: function replace(newItems) {\n    var adm = this[$mobx];\n    return adm.spliceWithArray_(0, adm.values_.length, newItems);\n  },\n  // Used by JSON.stringify\n  toJSON: function toJSON() {\n    return this.slice();\n  },\n  /*\r\n   * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n   * since these functions alter the inner structure of the array, the have side effects.\r\n   * Because the have side effects, they should not be used in computed function,\r\n   * and for that reason the do not call dependencyState.notifyObserved\r\n   */\n  splice: function splice(index, deleteCount) {\n    for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n      newItems[_key - 2] = arguments[_key];\n    }\n    var adm = this[$mobx];\n    switch (arguments.length) {\n      case 0:\n        return [];\n      case 1:\n        return adm.spliceWithArray_(index);\n      case 2:\n        return adm.spliceWithArray_(index, deleteCount);\n    }\n    return adm.spliceWithArray_(index, deleteCount, newItems);\n  },\n  spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n    return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n  },\n  push: function push() {\n    var adm = this[$mobx];\n    for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      items[_key2] = arguments[_key2];\n    }\n    adm.spliceWithArray_(adm.values_.length, 0, items);\n    return adm.values_.length;\n  },\n  pop: function pop() {\n    return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n  },\n  shift: function shift() {\n    return this.splice(0, 1)[0];\n  },\n  unshift: function unshift() {\n    var adm = this[$mobx];\n    for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n      items[_key3] = arguments[_key3];\n    }\n    adm.spliceWithArray_(0, 0, items);\n    return adm.values_.length;\n  },\n  reverse: function reverse() {\n    // reverse by default mutates in place before returning the result\n    // which makes it both a 'derivation' and a 'mutation'.\n    if (globalState.trackingDerivation) {\n      die(37, \"reverse\");\n    }\n    this.replace(this.slice().reverse());\n    return this;\n  },\n  sort: function sort() {\n    // sort by default mutates in place before returning the result\n    // which goes against all good practices. Let's not change the array in place!\n    if (globalState.trackingDerivation) {\n      die(37, \"sort\");\n    }\n    var copy = this.slice();\n    copy.sort.apply(copy, arguments);\n    this.replace(copy);\n    return this;\n  },\n  remove: function remove(value) {\n    var adm = this[$mobx];\n    var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n    if (idx > -1) {\n      this.splice(idx, 1);\n      return true;\n    }\n    return false;\n  }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n  if (typeof Array.prototype[funcName] === \"function\") {\n    arrayExtensions[funcName] = funcFactory(funcName);\n  }\n} // Report and delegate to dehanced array\n\nfunction simpleFunc(funcName) {\n  return function () {\n    var adm = this[$mobx];\n    adm.atom_.reportObserved();\n    var dehancedValues = adm.dehanceValues_(adm.values_);\n    return dehancedValues[funcName].apply(dehancedValues, arguments);\n  };\n} // Make sure callbacks recieve correct array arg #2326\n\nfunction mapLikeFunc(funcName) {\n  return function (callback, thisArg) {\n    var _this2 = this;\n    var adm = this[$mobx];\n    adm.atom_.reportObserved();\n    var dehancedValues = adm.dehanceValues_(adm.values_);\n    return dehancedValues[funcName](function (element, index) {\n      return callback.call(thisArg, element, index, _this2);\n    });\n  };\n} // Make sure callbacks recieve correct array arg #2326\n\nfunction reduceLikeFunc(funcName) {\n  return function () {\n    var _this3 = this;\n    var adm = this[$mobx];\n    adm.atom_.reportObserved();\n    var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n    var callback = arguments[0];\n    arguments[0] = function (accumulator, currentValue, index) {\n      return callback(accumulator, currentValue, index, _this3);\n    };\n    return dehancedValues[funcName].apply(dehancedValues, arguments);\n  };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n  return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n  // hasMap, not hashMap >-).\n  function ObservableMap(initialData, enhancer_, name_) {\n    var _this = this;\n    if (enhancer_ === void 0) {\n      enhancer_ = deepEnhancer;\n    }\n    if (name_ === void 0) {\n      name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableMap@\" + getNextId() : \"ObservableMap\";\n    }\n    this.enhancer_ = void 0;\n    this.name_ = void 0;\n    this[$mobx] = ObservableMapMarker;\n    this.data_ = void 0;\n    this.hasMap_ = void 0;\n    this.keysAtom_ = void 0;\n    this.interceptors_ = void 0;\n    this.changeListeners_ = void 0;\n    this.dehancer = void 0;\n    this.enhancer_ = enhancer_;\n    this.name_ = name_;\n    if (!isFunction(Map)) {\n      die(18);\n    }\n    this.keysAtom_ = createAtom(process.env.NODE_ENV !== \"production\" ? this.name_ + \".keys()\" : \"ObservableMap.keys()\");\n    this.data_ = new Map();\n    this.hasMap_ = new Map();\n    allowStateChanges(true, function () {\n      _this.merge(initialData);\n    });\n  }\n  var _proto = ObservableMap.prototype;\n  _proto.has_ = function has_(key) {\n    return this.data_.has(key);\n  };\n  _proto.has = function has(key) {\n    var _this2 = this;\n    if (!globalState.trackingDerivation) {\n      return this.has_(key);\n    }\n    var entry = this.hasMap_.get(key);\n    if (!entry) {\n      var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + stringifyKey(key) + \"?\" : \"ObservableMap.key?\", false);\n      this.hasMap_.set(key, newEntry);\n      onBecomeUnobserved(newEntry, function () {\n        return _this2.hasMap_[\"delete\"](key);\n      });\n    }\n    return entry.get();\n  };\n  _proto.set = function set(key, value) {\n    var hasKey = this.has_(key);\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        type: hasKey ? UPDATE : ADD,\n        object: this,\n        newValue: value,\n        name: key\n      });\n      if (!change) {\n        return this;\n      }\n      value = change.newValue;\n    }\n    if (hasKey) {\n      this.updateValue_(key, value);\n    } else {\n      this.addValue_(key, value);\n    }\n    return this;\n  };\n  _proto[\"delete\"] = function _delete(key) {\n    var _this3 = this;\n    checkIfStateModificationsAreAllowed(this.keysAtom_);\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        type: DELETE,\n        object: this,\n        name: key\n      });\n      if (!change) {\n        return false;\n      }\n    }\n    if (this.has_(key)) {\n      var notifySpy = isSpyEnabled();\n      var notify = hasListeners(this);\n      var _change = notify || notifySpy ? {\n        observableKind: \"map\",\n        debugObjectName: this.name_,\n        type: DELETE,\n        object: this,\n        oldValue: this.data_.get(key).value_,\n        name: key\n      } : null;\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportStart(_change);\n      } // TODO fix type\n\n      transaction(function () {\n        var _this3$hasMap_$get;\n        _this3.keysAtom_.reportChanged();\n        (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n        var observable = _this3.data_.get(key);\n        observable.setNewValue_(undefined);\n        _this3.data_[\"delete\"](key);\n      });\n      if (notify) {\n        notifyListeners(this, _change);\n      }\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportEnd();\n      }\n      return true;\n    }\n    return false;\n  };\n  _proto.updateValue_ = function updateValue_(key, newValue) {\n    var observable = this.data_.get(key);\n    newValue = observable.prepareNewValue_(newValue);\n    if (newValue !== globalState.UNCHANGED) {\n      var notifySpy = isSpyEnabled();\n      var notify = hasListeners(this);\n      var change = notify || notifySpy ? {\n        observableKind: \"map\",\n        debugObjectName: this.name_,\n        type: UPDATE,\n        object: this,\n        oldValue: observable.value_,\n        name: key,\n        newValue: newValue\n      } : null;\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportStart(change);\n      } // TODO fix type\n\n      observable.setNewValue_(newValue);\n      if (notify) {\n        notifyListeners(this, change);\n      }\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportEnd();\n      }\n    }\n  };\n  _proto.addValue_ = function addValue_(key, newValue) {\n    var _this4 = this;\n    checkIfStateModificationsAreAllowed(this.keysAtom_);\n    transaction(function () {\n      var _this4$hasMap_$get;\n      var observable = new ObservableValue(newValue, _this4.enhancer_, process.env.NODE_ENV !== \"production\" ? _this4.name_ + \".\" + stringifyKey(key) : \"ObservableMap.key\", false);\n      _this4.data_.set(key, observable);\n      newValue = observable.value_; // value might have been changed\n\n      (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n      _this4.keysAtom_.reportChanged();\n    });\n    var notifySpy = isSpyEnabled();\n    var notify = hasListeners(this);\n    var change = notify || notifySpy ? {\n      observableKind: \"map\",\n      debugObjectName: this.name_,\n      type: ADD,\n      object: this,\n      name: key,\n      newValue: newValue\n    } : null;\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportStart(change);\n    } // TODO fix type\n\n    if (notify) {\n      notifyListeners(this, change);\n    }\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportEnd();\n    }\n  };\n  _proto.get = function get(key) {\n    if (this.has(key)) {\n      return this.dehanceValue_(this.data_.get(key).get());\n    }\n    return this.dehanceValue_(undefined);\n  };\n  _proto.dehanceValue_ = function dehanceValue_(value) {\n    if (this.dehancer !== undefined) {\n      return this.dehancer(value);\n    }\n    return value;\n  };\n  _proto.keys = function keys() {\n    this.keysAtom_.reportObserved();\n    return this.data_.keys();\n  };\n  _proto.values = function values() {\n    var self = this;\n    var keys = this.keys();\n    return makeIterable({\n      next: function next() {\n        var _keys$next = keys.next(),\n          done = _keys$next.done,\n          value = _keys$next.value;\n        return {\n          done: done,\n          value: done ? undefined : self.get(value)\n        };\n      }\n    });\n  };\n  _proto.entries = function entries() {\n    var self = this;\n    var keys = this.keys();\n    return makeIterable({\n      next: function next() {\n        var _keys$next2 = keys.next(),\n          done = _keys$next2.done,\n          value = _keys$next2.value;\n        return {\n          done: done,\n          value: done ? undefined : [value, self.get(value)]\n        };\n      }\n    });\n  };\n  _proto[_Symbol$iterator] = function () {\n    return this.entries();\n  };\n  _proto.forEach = function forEach(callback, thisArg) {\n    for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n      var _step$value = _step.value,\n        key = _step$value[0],\n        value = _step$value[1];\n      callback.call(thisArg, value, key, this);\n    }\n  }\n  /** Merge another object into this object, returns this. */;\n\n  _proto.merge = function merge(other) {\n    var _this5 = this;\n    if (isObservableMap(other)) {\n      other = new Map(other);\n    }\n    transaction(function () {\n      if (isPlainObject(other)) {\n        getPlainObjectKeys(other).forEach(function (key) {\n          return _this5.set(key, other[key]);\n        });\n      } else if (Array.isArray(other)) {\n        other.forEach(function (_ref) {\n          var key = _ref[0],\n            value = _ref[1];\n          return _this5.set(key, value);\n        });\n      } else if (isES6Map(other)) {\n        if (other.constructor !== Map) {\n          die(19, other);\n        }\n        other.forEach(function (value, key) {\n          return _this5.set(key, value);\n        });\n      } else if (other !== null && other !== undefined) {\n        die(20, other);\n      }\n    });\n    return this;\n  };\n  _proto.clear = function clear() {\n    var _this6 = this;\n    transaction(function () {\n      untracked(function () {\n        for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n          var key = _step2.value;\n          _this6[\"delete\"](key);\n        }\n      });\n    });\n  };\n  _proto.replace = function replace(values) {\n    var _this7 = this;\n\n    // Implementation requirements:\n    // - respect ordering of replacement map\n    // - allow interceptors to run and potentially prevent individual operations\n    // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n    // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n    // - note that result map may differ from replacement map due to the interceptors\n    transaction(function () {\n      // Convert to map so we can do quick key lookups\n      var replacementMap = convertToMap(values);\n      var orderedData = new Map(); // Used for optimization\n\n      var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n      // if the key deletion is prevented by interceptor\n      // add entry at the beginning of the result map\n\n      for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n        var key = _step3.value;\n\n        // Concurrently iterating/deleting keys\n        // iterator should handle this correctly\n        if (!replacementMap.has(key)) {\n          var deleted = _this7[\"delete\"](key); // Was the key removed?\n\n          if (deleted) {\n            // _keysAtom.reportChanged() was already called\n            keysReportChangedCalled = true;\n          } else {\n            // Delete prevented by interceptor\n            var value = _this7.data_.get(key);\n            orderedData.set(key, value);\n          }\n        }\n      } // Merge entries\n\n      for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n        var _step4$value = _step4.value,\n          _key = _step4$value[0],\n          _value = _step4$value[1];\n\n        // We will want to know whether a new key is added\n        var keyExisted = _this7.data_.has(_key); // Add or update value\n\n        _this7.set(_key, _value); // The addition could have been prevent by interceptor\n\n        if (_this7.data_.has(_key)) {\n          // The update could have been prevented by interceptor\n          // and also we want to preserve existing values\n          // so use value from _data map (instead of replacement map)\n          var _value2 = _this7.data_.get(_key);\n          orderedData.set(_key, _value2); // Was a new key added?\n\n          if (!keyExisted) {\n            // _keysAtom.reportChanged() was already called\n            keysReportChangedCalled = true;\n          }\n        }\n      } // Check for possible key order change\n\n      if (!keysReportChangedCalled) {\n        if (_this7.data_.size !== orderedData.size) {\n          // If size differs, keys are definitely modified\n          _this7.keysAtom_.reportChanged();\n        } else {\n          var iter1 = _this7.data_.keys();\n          var iter2 = orderedData.keys();\n          var next1 = iter1.next();\n          var next2 = iter2.next();\n          while (!next1.done) {\n            if (next1.value !== next2.value) {\n              _this7.keysAtom_.reportChanged();\n              break;\n            }\n            next1 = iter1.next();\n            next2 = iter2.next();\n          }\n        }\n      } // Use correctly ordered map\n\n      _this7.data_ = orderedData;\n    });\n    return this;\n  };\n  _proto.toString = function toString() {\n    return \"[object ObservableMap]\";\n  };\n  _proto.toJSON = function toJSON() {\n    return Array.from(this);\n  };\n\n  /**\r\n   * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n   * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n   * for callback details\r\n   */\n  _proto.observe_ = function observe_(listener, fireImmediately) {\n    if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n      die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n    }\n    return registerListener(this, listener);\n  };\n  _proto.intercept_ = function intercept_(handler) {\n    return registerInterceptor(this, handler);\n  };\n  _createClass(ObservableMap, [{\n    key: \"size\",\n    get: function get() {\n      this.keysAtom_.reportObserved();\n      return this.data_.size;\n    }\n  }, {\n    key: _Symbol$toStringTag,\n    get: function get() {\n      return \"Map\";\n    }\n  }]);\n  return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n  if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n    return dataStructure;\n  } else if (Array.isArray(dataStructure)) {\n    return new Map(dataStructure);\n  } else if (isPlainObject(dataStructure)) {\n    var map = new Map();\n    for (var key in dataStructure) {\n      map.set(key, dataStructure[key]);\n    }\n    return map;\n  } else {\n    return die(21, dataStructure);\n  }\n}\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n  function ObservableSet(initialData, enhancer, name_) {\n    if (enhancer === void 0) {\n      enhancer = deepEnhancer;\n    }\n    if (name_ === void 0) {\n      name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableSet@\" + getNextId() : \"ObservableSet\";\n    }\n    this.name_ = void 0;\n    this[$mobx] = ObservableSetMarker;\n    this.data_ = new Set();\n    this.atom_ = void 0;\n    this.changeListeners_ = void 0;\n    this.interceptors_ = void 0;\n    this.dehancer = void 0;\n    this.enhancer_ = void 0;\n    this.name_ = name_;\n    if (!isFunction(Set)) {\n      die(22);\n    }\n    this.atom_ = createAtom(this.name_);\n    this.enhancer_ = function (newV, oldV) {\n      return enhancer(newV, oldV, name_);\n    };\n    if (initialData) {\n      this.replace(initialData);\n    }\n  }\n  var _proto = ObservableSet.prototype;\n  _proto.dehanceValue_ = function dehanceValue_(value) {\n    if (this.dehancer !== undefined) {\n      return this.dehancer(value);\n    }\n    return value;\n  };\n  _proto.clear = function clear() {\n    var _this = this;\n    transaction(function () {\n      untracked(function () {\n        for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n          var value = _step.value;\n          _this[\"delete\"](value);\n        }\n      });\n    });\n  };\n  _proto.forEach = function forEach(callbackFn, thisArg) {\n    for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n      var value = _step2.value;\n      callbackFn.call(thisArg, value, value, this);\n    }\n  };\n  _proto.add = function add(value) {\n    var _this2 = this;\n    checkIfStateModificationsAreAllowed(this.atom_);\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        type: ADD,\n        object: this,\n        newValue: value\n      });\n      if (!change) {\n        return this;\n      } // ideally, value = change.value would be done here, so that values can be\n      // changed by interceptor. Same applies for other Set and Map api's.\n    }\n\n    if (!this.has(value)) {\n      transaction(function () {\n        _this2.data_.add(_this2.enhancer_(value, undefined));\n        _this2.atom_.reportChanged();\n      });\n      var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n      var notify = hasListeners(this);\n      var _change = notify || notifySpy ? {\n        observableKind: \"set\",\n        debugObjectName: this.name_,\n        type: ADD,\n        object: this,\n        newValue: value\n      } : null;\n      if (notifySpy && process.env.NODE_ENV !== \"production\") {\n        spyReportStart(_change);\n      }\n      if (notify) {\n        notifyListeners(this, _change);\n      }\n      if (notifySpy && process.env.NODE_ENV !== \"production\") {\n        spyReportEnd();\n      }\n    }\n    return this;\n  };\n  _proto[\"delete\"] = function _delete(value) {\n    var _this3 = this;\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        type: DELETE,\n        object: this,\n        oldValue: value\n      });\n      if (!change) {\n        return false;\n      }\n    }\n    if (this.has(value)) {\n      var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n      var notify = hasListeners(this);\n      var _change2 = notify || notifySpy ? {\n        observableKind: \"set\",\n        debugObjectName: this.name_,\n        type: DELETE,\n        object: this,\n        oldValue: value\n      } : null;\n      if (notifySpy && process.env.NODE_ENV !== \"production\") {\n        spyReportStart(_change2);\n      }\n      transaction(function () {\n        _this3.atom_.reportChanged();\n        _this3.data_[\"delete\"](value);\n      });\n      if (notify) {\n        notifyListeners(this, _change2);\n      }\n      if (notifySpy && process.env.NODE_ENV !== \"production\") {\n        spyReportEnd();\n      }\n      return true;\n    }\n    return false;\n  };\n  _proto.has = function has(value) {\n    this.atom_.reportObserved();\n    return this.data_.has(this.dehanceValue_(value));\n  };\n  _proto.entries = function entries() {\n    var nextIndex = 0;\n    var keys = Array.from(this.keys());\n    var values = Array.from(this.values());\n    return makeIterable({\n      next: function next() {\n        var index = nextIndex;\n        nextIndex += 1;\n        return index < values.length ? {\n          value: [keys[index], values[index]],\n          done: false\n        } : {\n          done: true\n        };\n      }\n    });\n  };\n  _proto.keys = function keys() {\n    return this.values();\n  };\n  _proto.values = function values() {\n    this.atom_.reportObserved();\n    var self = this;\n    var nextIndex = 0;\n    var observableValues = Array.from(this.data_.values());\n    return makeIterable({\n      next: function next() {\n        return nextIndex < observableValues.length ? {\n          value: self.dehanceValue_(observableValues[nextIndex++]),\n          done: false\n        } : {\n          done: true\n        };\n      }\n    });\n  };\n  _proto.replace = function replace(other) {\n    var _this4 = this;\n    if (isObservableSet(other)) {\n      other = new Set(other);\n    }\n    transaction(function () {\n      if (Array.isArray(other)) {\n        _this4.clear();\n        other.forEach(function (value) {\n          return _this4.add(value);\n        });\n      } else if (isES6Set(other)) {\n        _this4.clear();\n        other.forEach(function (value) {\n          return _this4.add(value);\n        });\n      } else if (other !== null && other !== undefined) {\n        die(\"Cannot initialize set from \" + other);\n      }\n    });\n    return this;\n  };\n  _proto.observe_ = function observe_(listener, fireImmediately) {\n    // ... 'fireImmediately' could also be true?\n    if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n      die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n    }\n    return registerListener(this, listener);\n  };\n  _proto.intercept_ = function intercept_(handler) {\n    return registerInterceptor(this, handler);\n  };\n  _proto.toJSON = function toJSON() {\n    return Array.from(this);\n  };\n  _proto.toString = function toString() {\n    return \"[object ObservableSet]\";\n  };\n  _proto[_Symbol$iterator$1] = function () {\n    return this.values();\n  };\n  _createClass(ObservableSet, [{\n    key: \"size\",\n    get: function get() {\n      this.atom_.reportObserved();\n      return this.data_.size;\n    }\n  }, {\n    key: _Symbol$toStringTag$1,\n    get: function get() {\n      return \"Set\";\n    }\n  }]);\n  return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n  function ObservableObjectAdministration(target_, values_, name_,\n  // Used anytime annotation is not explicitely provided\n  defaultAnnotation_) {\n    if (values_ === void 0) {\n      values_ = new Map();\n    }\n    if (defaultAnnotation_ === void 0) {\n      defaultAnnotation_ = autoAnnotation;\n    }\n    this.target_ = void 0;\n    this.values_ = void 0;\n    this.name_ = void 0;\n    this.defaultAnnotation_ = void 0;\n    this.keysAtom_ = void 0;\n    this.changeListeners_ = void 0;\n    this.interceptors_ = void 0;\n    this.proxy_ = void 0;\n    this.isPlainObject_ = void 0;\n    this.appliedAnnotations_ = void 0;\n    this.pendingKeys_ = void 0;\n    this.target_ = target_;\n    this.values_ = values_;\n    this.name_ = name_;\n    this.defaultAnnotation_ = defaultAnnotation_;\n    this.keysAtom_ = new Atom(process.env.NODE_ENV !== \"production\" ? this.name_ + \".keys\" : \"ObservableObject.keys\"); // Optimization: we use this frequently\n\n    this.isPlainObject_ = isPlainObject(this.target_);\n    if (process.env.NODE_ENV !== \"production\" && !isAnnotation(this.defaultAnnotation_)) {\n      die(\"defaultAnnotation must be valid annotation\");\n    }\n    if (process.env.NODE_ENV !== \"production\") {\n      // Prepare structure for tracking which fields were already annotated\n      this.appliedAnnotations_ = {};\n    }\n  }\n  var _proto = ObservableObjectAdministration.prototype;\n  _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n    return this.values_.get(key).get();\n  };\n  _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n    var observable = this.values_.get(key);\n    if (observable instanceof ComputedValue) {\n      observable.set(newValue);\n      return true;\n    } // intercept\n\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        type: UPDATE,\n        object: this.proxy_ || this.target_,\n        name: key,\n        newValue: newValue\n      });\n      if (!change) {\n        return null;\n      }\n      newValue = change.newValue;\n    }\n    newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n    if (newValue !== globalState.UNCHANGED) {\n      var notify = hasListeners(this);\n      var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n      var _change = notify || notifySpy ? {\n        type: UPDATE,\n        observableKind: \"object\",\n        debugObjectName: this.name_,\n        object: this.proxy_ || this.target_,\n        oldValue: observable.value_,\n        name: key,\n        newValue: newValue\n      } : null;\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportStart(_change);\n      }\n      observable.setNewValue_(newValue);\n      if (notify) {\n        notifyListeners(this, _change);\n      }\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportEnd();\n      }\n    }\n    return true;\n  };\n  _proto.get_ = function get_(key) {\n    if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n      // Key doesn't exist yet, subscribe for it in case it's added later\n      this.has_(key);\n    }\n    return this.target_[key];\n  }\n  /**\r\n   * @param {PropertyKey} key\r\n   * @param {any} value\r\n   * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n   * @param {boolean} proxyTrap whether it's called from proxy trap\r\n   * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n   */;\n\n  _proto.set_ = function set_(key, value, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n\n    // Don't use .has(key) - we care about own\n    if (hasProp(this.target_, key)) {\n      // Existing prop\n      if (this.values_.has(key)) {\n        // Observable (can be intercepted)\n        return this.setObservablePropValue_(key, value);\n      } else if (proxyTrap) {\n        // Non-observable - proxy\n        return Reflect.set(this.target_, key, value);\n      } else {\n        // Non-observable\n        this.target_[key] = value;\n        return true;\n      }\n    } else {\n      // New prop\n      return this.extend_(key, {\n        value: value,\n        enumerable: true,\n        writable: true,\n        configurable: true\n      }, this.defaultAnnotation_, proxyTrap);\n    }\n  } // Trap for \"in\"\n  ;\n\n  _proto.has_ = function has_(key) {\n    if (!globalState.trackingDerivation) {\n      // Skip key subscription outside derivation\n      return key in this.target_;\n    }\n    this.pendingKeys_ || (this.pendingKeys_ = new Map());\n    var entry = this.pendingKeys_.get(key);\n    if (!entry) {\n      entry = new ObservableValue(key in this.target_, referenceEnhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + stringifyKey(key) + \"?\" : \"ObservableObject.key?\", false);\n      this.pendingKeys_.set(key, entry);\n    }\n    return entry.get();\n  }\n  /**\r\n   * @param {PropertyKey} key\r\n   * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n   */;\n\n  _proto.make_ = function make_(key, annotation) {\n    if (annotation === true) {\n      annotation = this.defaultAnnotation_;\n    }\n    if (annotation === false) {\n      return;\n    }\n    assertAnnotable(this, annotation, key);\n    if (!(key in this.target_)) {\n      var _this$target_$storedA;\n\n      // Throw on missing key, except for decorators:\n      // Decorator annotations are collected from whole prototype chain.\n      // When called from super() some props may not exist yet.\n      // However we don't have to worry about missing prop,\n      // because the decorator must have been applied to something.\n      if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n        return; // will be annotated by subclass constructor\n      } else {\n        die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n      }\n    }\n    var source = this.target_;\n    while (source && source !== objectPrototype) {\n      var descriptor = getDescriptor(source, key);\n      if (descriptor) {\n        var outcome = annotation.make_(this, key, descriptor, source);\n        if (outcome === 0\n        /* Cancel */) {\n          return;\n        }\n        if (outcome === 1\n        /* Break */) {\n          break;\n        }\n      }\n      source = Object.getPrototypeOf(source);\n    }\n    recordAnnotationApplied(this, annotation, key);\n  }\n  /**\r\n   * @param {PropertyKey} key\r\n   * @param {PropertyDescriptor} descriptor\r\n   * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n   * @param {boolean} proxyTrap whether it's called from proxy trap\r\n   * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n   */;\n\n  _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n    if (annotation === true) {\n      annotation = this.defaultAnnotation_;\n    }\n    if (annotation === false) {\n      return this.defineProperty_(key, descriptor, proxyTrap);\n    }\n    assertAnnotable(this, annotation, key);\n    var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n    if (outcome) {\n      recordAnnotationApplied(this, annotation, key);\n    }\n    return outcome;\n  }\n  /**\r\n   * @param {PropertyKey} key\r\n   * @param {PropertyDescriptor} descriptor\r\n   * @param {boolean} proxyTrap whether it's called from proxy trap\r\n   * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n   */;\n\n  _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n    try {\n      startBatch(); // Delete\n\n      var deleteOutcome = this.delete_(key);\n      if (!deleteOutcome) {\n        // Failure or intercepted\n        return deleteOutcome;\n      } // ADD interceptor\n\n      if (hasInterceptors(this)) {\n        var change = interceptChange(this, {\n          object: this.proxy_ || this.target_,\n          name: key,\n          type: ADD,\n          newValue: descriptor.value\n        });\n        if (!change) {\n          return null;\n        }\n        var newValue = change.newValue;\n        if (descriptor.value !== newValue) {\n          descriptor = _extends({}, descriptor, {\n            value: newValue\n          });\n        }\n      } // Define\n\n      if (proxyTrap) {\n        if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n          return false;\n        }\n      } else {\n        defineProperty(this.target_, key, descriptor);\n      } // Notify\n\n      this.notifyPropertyAddition_(key, descriptor.value);\n    } finally {\n      endBatch();\n    }\n    return true;\n  } // If original descriptor becomes relevant, move this to annotation directly\n  ;\n\n  _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n    try {\n      startBatch(); // Delete\n\n      var deleteOutcome = this.delete_(key);\n      if (!deleteOutcome) {\n        // Failure or intercepted\n        return deleteOutcome;\n      } // ADD interceptor\n\n      if (hasInterceptors(this)) {\n        var change = interceptChange(this, {\n          object: this.proxy_ || this.target_,\n          name: key,\n          type: ADD,\n          newValue: value\n        });\n        if (!change) {\n          return null;\n        }\n        value = change.newValue;\n      }\n      var cachedDescriptor = getCachedObservablePropDescriptor(key);\n      var descriptor = {\n        configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n        enumerable: true,\n        get: cachedDescriptor.get,\n        set: cachedDescriptor.set\n      }; // Define\n\n      if (proxyTrap) {\n        if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n          return false;\n        }\n      } else {\n        defineProperty(this.target_, key, descriptor);\n      }\n      var observable = new ObservableValue(value, enhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + key.toString() : \"ObservableObject.key\", false);\n      this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n      this.notifyPropertyAddition_(key, observable.value_);\n    } finally {\n      endBatch();\n    }\n    return true;\n  } // If original descriptor becomes relevant, move this to annotation directly\n  ;\n\n  _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n    try {\n      startBatch(); // Delete\n\n      var deleteOutcome = this.delete_(key);\n      if (!deleteOutcome) {\n        // Failure or intercepted\n        return deleteOutcome;\n      } // ADD interceptor\n\n      if (hasInterceptors(this)) {\n        var change = interceptChange(this, {\n          object: this.proxy_ || this.target_,\n          name: key,\n          type: ADD,\n          newValue: undefined\n        });\n        if (!change) {\n          return null;\n        }\n      }\n      options.name || (options.name = process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + key.toString() : \"ObservableObject.key\");\n      options.context = this.proxy_ || this.target_;\n      var cachedDescriptor = getCachedObservablePropDescriptor(key);\n      var descriptor = {\n        configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n        enumerable: false,\n        get: cachedDescriptor.get,\n        set: cachedDescriptor.set\n      }; // Define\n\n      if (proxyTrap) {\n        if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n          return false;\n        }\n      } else {\n        defineProperty(this.target_, key, descriptor);\n      }\n      this.values_.set(key, new ComputedValue(options)); // Notify\n\n      this.notifyPropertyAddition_(key, undefined);\n    } finally {\n      endBatch();\n    }\n    return true;\n  }\n  /**\r\n   * @param {PropertyKey} key\r\n   * @param {PropertyDescriptor} descriptor\r\n   * @param {boolean} proxyTrap whether it's called from proxy trap\r\n   * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n   */;\n\n  _proto.delete_ = function delete_(key, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n\n    // No such prop\n    if (!hasProp(this.target_, key)) {\n      return true;\n    } // Intercept\n\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        object: this.proxy_ || this.target_,\n        name: key,\n        type: REMOVE\n      }); // Cancelled\n\n      if (!change) {\n        return null;\n      }\n    } // Delete\n\n    try {\n      var _this$pendingKeys_, _this$pendingKeys_$ge;\n      startBatch();\n      var notify = hasListeners(this);\n      var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n      var observable = this.values_.get(key); // Value needed for spies/listeners\n\n      var value = undefined; // Optimization: don't pull the value unless we will need it\n\n      if (!observable && (notify || notifySpy)) {\n        var _getDescriptor;\n        value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n      } // delete prop (do first, may fail)\n\n      if (proxyTrap) {\n        if (!Reflect.deleteProperty(this.target_, key)) {\n          return false;\n        }\n      } else {\n        delete this.target_[key];\n      } // Allow re-annotating this field\n\n      if (process.env.NODE_ENV !== \"production\") {\n        delete this.appliedAnnotations_[key];\n      } // Clear observable\n\n      if (observable) {\n        this.values_[\"delete\"](key); // for computed, value is undefined\n\n        if (observable instanceof ObservableValue) {\n          value = observable.value_;\n        } // Notify: autorun(() => obj[key]), see #1796\n\n        propagateChanged(observable);\n      } // Notify \"keys/entries/values\" observers\n\n      this.keysAtom_.reportChanged(); // Notify \"has\" observers\n      // \"in\" as it may still exist in proto\n\n      (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n      if (notify || notifySpy) {\n        var _change2 = {\n          type: REMOVE,\n          observableKind: \"object\",\n          object: this.proxy_ || this.target_,\n          debugObjectName: this.name_,\n          oldValue: value,\n          name: key\n        };\n        if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n          spyReportStart(_change2);\n        }\n        if (notify) {\n          notifyListeners(this, _change2);\n        }\n        if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n          spyReportEnd();\n        }\n      }\n    } finally {\n      endBatch();\n    }\n    return true;\n  }\n  /**\r\n   * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n   * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n   * for callback details\r\n   */;\n\n  _proto.observe_ = function observe_(callback, fireImmediately) {\n    if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n      die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n    }\n    return registerListener(this, callback);\n  };\n  _proto.intercept_ = function intercept_(handler) {\n    return registerInterceptor(this, handler);\n  };\n  _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n    var _this$pendingKeys_2, _this$pendingKeys_2$g;\n    var notify = hasListeners(this);\n    var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n    if (notify || notifySpy) {\n      var change = notify || notifySpy ? {\n        type: ADD,\n        observableKind: \"object\",\n        debugObjectName: this.name_,\n        object: this.proxy_ || this.target_,\n        name: key,\n        newValue: value\n      } : null;\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportStart(change);\n      }\n      if (notify) {\n        notifyListeners(this, change);\n      }\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportEnd();\n      }\n    }\n    (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n    this.keysAtom_.reportChanged();\n  };\n  _proto.ownKeys_ = function ownKeys_() {\n    this.keysAtom_.reportObserved();\n    return ownKeys(this.target_);\n  };\n  _proto.keys_ = function keys_() {\n    // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n    // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n    // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n    // We choose to over-report in Object.keys(object), because:\n    // - typically it's used with simple data objects\n    // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n    this.keysAtom_.reportObserved();\n    return Object.keys(this.target_);\n  };\n  return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n  var _options$name;\n  if (process.env.NODE_ENV !== \"production\" && options && isObservableObject(target)) {\n    die(\"Options can't be provided for already observable objects.\");\n  }\n  if (hasProp(target, $mobx)) {\n    if (process.env.NODE_ENV !== \"production\" && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n      die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n    }\n    return target;\n  }\n  if (process.env.NODE_ENV !== \"production\" && !Object.isExtensible(target)) {\n    die(\"Cannot make the designated object observable; it is not extensible\");\n  }\n  var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : process.env.NODE_ENV !== \"production\" ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : \"ObservableObject\";\n  var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n  addHiddenProp(target, $mobx, adm);\n  return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n  return descriptorCache[key] || (descriptorCache[key] = {\n    get: function get() {\n      return this[$mobx].getObservablePropValue_(key);\n    },\n    set: function set(value) {\n      return this[$mobx].setObservablePropValue_(key, value);\n    }\n  });\n}\nfunction isObservableObject(thing) {\n  if (isObject(thing)) {\n    return isObservableObjectAdministration(thing[$mobx]);\n  }\n  return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n  var _adm$target_$storedAn;\n  if (process.env.NODE_ENV !== \"production\") {\n    adm.appliedAnnotations_[key] = annotation;\n  } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n  (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n  // Valid annotation\n  if (process.env.NODE_ENV !== \"production\" && !isAnnotation(annotation)) {\n    die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n  }\n  /*\r\n  // Configurable, not sealed, not frozen\r\n  // Possibly not needed, just a little better error then the one thrown by engine.\r\n  // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n  if (__DEV__) {\r\n      const configurable = getDescriptor(adm.target_, key)?.configurable\r\n      const frozen = Object.isFrozen(adm.target_)\r\n      const sealed = Object.isSealed(adm.target_)\r\n      if (!configurable || frozen || sealed) {\r\n          const fieldName = `${adm.name_}.${key.toString()}`\r\n          const requestedAnnotationType = annotation.annotationType_\r\n          let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n          if (frozen) {\r\n              error += `\\nObject is frozen.`\r\n          }\r\n          if (sealed) {\r\n              error += `\\nObject is sealed.`\r\n          }\r\n          if (!configurable) {\r\n              error += `\\nproperty is not configurable.`\r\n              // Mention only if caused by us to avoid confusion\r\n              if (hasProp(adm.appliedAnnotations!, key)) {\r\n                  error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n                  error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n              }\r\n          }\r\n          die(error)\r\n      }\r\n  }\r\n  */\n  // Not annotated\n\n  if (process.env.NODE_ENV !== \"production\" && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n    var fieldName = adm.name_ + \".\" + key.toString();\n    var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n    var requestedAnnotationType = annotation.annotationType_;\n    die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n  }\n}\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n  if (Object.setPrototypeOf) {\n    Object.setPrototypeOf(ctor.prototype, proto);\n  } else if (ctor.prototype.__proto__ !== undefined) {\n    ctor.prototype.__proto__ = proto;\n  } else {\n    ctor.prototype = proto;\n  }\n}\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n  _inheritsLoose(LegacyObservableArray, _StubArray);\n  function LegacyObservableArray(initialValues, enhancer, name, owned) {\n    var _this;\n    if (name === void 0) {\n      name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n    }\n    if (owned === void 0) {\n      owned = false;\n    }\n    _this = _StubArray.call(this) || this;\n    var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n    adm.proxy_ = _assertThisInitialized(_this);\n    addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n    if (initialValues && initialValues.length) {\n      var prev = allowStateChangesStart(true); // @ts-ignore\n\n      _this.spliceWithArray(0, 0, initialValues);\n      allowStateChangesEnd(prev);\n    }\n    {\n      // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n      // defined on the instance. After that it works fine, even if this property is deleted.\n      Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n    }\n    return _this;\n  }\n  var _proto = LegacyObservableArray.prototype;\n  _proto.concat = function concat() {\n    this[$mobx].atom_.reportObserved();\n    for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n      arrays[_key] = arguments[_key];\n    }\n    return Array.prototype.concat.apply(this.slice(),\n    //@ts-ignore\n    arrays.map(function (a) {\n      return isObservableArray(a) ? a.slice() : a;\n    }));\n  };\n  _proto[_Symbol$iterator] = function () {\n    var self = this;\n    var nextIndex = 0;\n    return makeIterable({\n      next: function next() {\n        return nextIndex < self.length ? {\n          value: self[nextIndex++],\n          done: false\n        } : {\n          done: true,\n          value: undefined\n        };\n      }\n    });\n  };\n  _createClass(LegacyObservableArray, [{\n    key: \"length\",\n    get: function get() {\n      return this[$mobx].getArrayLength_();\n    },\n    set: function set(newLength) {\n      this[$mobx].setArrayLength_(newLength);\n    }\n  }, {\n    key: _Symbol$toStringTag,\n    get: function get() {\n      return \"Array\";\n    }\n  }]);\n  return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n  var prop = _ref[0],\n    fn = _ref[1];\n  if (prop !== \"concat\") {\n    addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n  }\n});\nfunction createArrayEntryDescriptor(index) {\n  return {\n    enumerable: false,\n    configurable: true,\n    get: function get() {\n      return this[$mobx].get_(index);\n    },\n    set: function set(value) {\n      this[$mobx].set_(index, value);\n    }\n  };\n}\nfunction createArrayBufferItem(index) {\n  defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n  if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n    for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n      createArrayBufferItem(index);\n    }\n    OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n  }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n  return new LegacyObservableArray(initialValues, enhancer, name);\n}\nfunction getAtom(thing, property) {\n  if (typeof thing === \"object\" && thing !== null) {\n    if (isObservableArray(thing)) {\n      if (property !== undefined) {\n        die(23);\n      }\n      return thing[$mobx].atom_;\n    }\n    if (isObservableSet(thing)) {\n      return thing[$mobx];\n    }\n    if (isObservableMap(thing)) {\n      if (property === undefined) {\n        return thing.keysAtom_;\n      }\n      var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n      if (!observable) {\n        die(25, property, getDebugName(thing));\n      }\n      return observable;\n    }\n    if (isObservableObject(thing)) {\n      if (!property) {\n        return die(26);\n      }\n      var _observable = thing[$mobx].values_.get(property);\n      if (!_observable) {\n        die(27, property, getDebugName(thing));\n      }\n      return _observable;\n    }\n    if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n      return thing;\n    }\n  } else if (isFunction(thing)) {\n    if (isReaction(thing[$mobx])) {\n      // disposer function\n      return thing[$mobx];\n    }\n  }\n  die(28);\n}\nfunction getAdministration(thing, property) {\n  if (!thing) {\n    die(29);\n  }\n  if (property !== undefined) {\n    return getAdministration(getAtom(thing, property));\n  }\n  if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n    return thing;\n  }\n  if (isObservableMap(thing) || isObservableSet(thing)) {\n    return thing;\n  }\n  if (thing[$mobx]) {\n    return thing[$mobx];\n  }\n  die(24, thing);\n}\nfunction getDebugName(thing, property) {\n  var named;\n  if (property !== undefined) {\n    named = getAtom(thing, property);\n  } else if (isAction(thing)) {\n    return thing.name;\n  } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n    named = getAdministration(thing);\n  } else {\n    // valid for arrays as well\n    named = getAtom(thing);\n  }\n  return named.name_;\n}\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n  if (depth === void 0) {\n    depth = -1;\n  }\n  return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n  // Identical objects are equal. `0 === -0`, but they aren't identical.\n  // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n  if (a === b) {\n    return a !== 0 || 1 / a === 1 / b;\n  } // `null` or `undefined` only equal to itself (strict comparison).\n\n  if (a == null || b == null) {\n    return false;\n  } // `NaN`s are equivalent, but non-reflexive.\n\n  if (a !== a) {\n    return b !== b;\n  } // Exhaust primitive checks\n\n  var type = typeof a;\n  if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n    return false;\n  } // Compare `[[Class]]` names.\n\n  var className = toString.call(a);\n  if (className !== toString.call(b)) {\n    return false;\n  }\n  switch (className) {\n    // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n    case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n    case \"[object String]\":\n      // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n      // equivalent to `new String(\"5\")`.\n      return \"\" + a === \"\" + b;\n    case \"[object Number]\":\n      // `NaN`s are equivalent, but non-reflexive.\n      // Object(NaN) is equivalent to NaN.\n      if (+a !== +a) {\n        return +b !== +b;\n      } // An `egal` comparison is performed for other numeric values.\n\n      return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n    case \"[object Date]\":\n    case \"[object Boolean]\":\n      // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n      // millisecond representations. Note that invalid dates with millisecond representations\n      // of `NaN` are not equivalent.\n      return +a === +b;\n    case \"[object Symbol]\":\n      return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n    case \"[object Map]\":\n    case \"[object Set]\":\n      // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n      // Hide this extra level by increasing the depth.\n      if (depth >= 0) {\n        depth++;\n      }\n      break;\n  } // Unwrap any wrapped objects.\n\n  a = unwrap(a);\n  b = unwrap(b);\n  var areArrays = className === \"[object Array]\";\n  if (!areArrays) {\n    if (typeof a != \"object\" || typeof b != \"object\") {\n      return false;\n    } // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n    // from different frames are.\n\n    var aCtor = a.constructor,\n      bCtor = b.constructor;\n    if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n      return false;\n    }\n  }\n  if (depth === 0) {\n    return false;\n  } else if (depth < 0) {\n    depth = -1;\n  } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n  // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n  // Initializing stack of traversed objects.\n  // It's done here since we only need them for objects and arrays comparison.\n\n  aStack = aStack || [];\n  bStack = bStack || [];\n  var length = aStack.length;\n  while (length--) {\n    // Linear search. Performance is inversely proportional to the number of\n    // unique nested structures.\n    if (aStack[length] === a) {\n      return bStack[length] === b;\n    }\n  } // Add the first object to the stack of traversed objects.\n\n  aStack.push(a);\n  bStack.push(b); // Recursively compare objects and arrays.\n\n  if (areArrays) {\n    // Compare array lengths to determine if a deep comparison is necessary.\n    length = a.length;\n    if (length !== b.length) {\n      return false;\n    } // Deep compare the contents, ignoring non-numeric properties.\n\n    while (length--) {\n      if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n        return false;\n      }\n    }\n  } else {\n    // Deep compare objects.\n    var keys = Object.keys(a);\n    var key;\n    length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n    if (Object.keys(b).length !== length) {\n      return false;\n    }\n    while (length--) {\n      // Deep compare each member\n      key = keys[length];\n      if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n        return false;\n      }\n    }\n  } // Remove the first object from the stack of traversed objects.\n\n  aStack.pop();\n  bStack.pop();\n  return true;\n}\nfunction unwrap(a) {\n  if (isObservableArray(a)) {\n    return a.slice();\n  }\n  if (isES6Map(a) || isObservableMap(a)) {\n    return Array.from(a.entries());\n  }\n  if (isES6Set(a) || isObservableSet(a)) {\n    return Array.from(a.entries());\n  }\n  return a;\n}\nfunction makeIterable(iterator) {\n  iterator[Symbol.iterator] = getSelf;\n  return iterator;\n}\nfunction getSelf() {\n  return this;\n}\nfunction isAnnotation(thing) {\n  return (\n    // Can be function\n    thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n  );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/     Most of the public static methods exposed by the module can be found here.\r\n * - core/    Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/   All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/   Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n  var g = getGlobal();\n  if (typeof g[m] === \"undefined\") {\n    die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n  }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n  // See: https://github.com/andykog/mobx-devtools/\n  __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n    spy: spy,\n    extras: {\n      getDebugName: getDebugName\n    },\n    $mobx: $mobx\n  });\n}\nexport { $mobx, FlowCancellationError, ObservableMap, ObservableSet, Reaction, allowStateChanges as _allowStateChanges, runInAction as _allowStateChangesInsideComputed, allowStateReadsEnd as _allowStateReadsEnd, allowStateReadsStart as _allowStateReadsStart, autoAction as _autoAction, _endAction, getAdministration as _getAdministration, getGlobalState as _getGlobalState, interceptReads as _interceptReads, isComputingDerivation as _isComputingDerivation, resetGlobalState as _resetGlobalState, _startAction, action, autorun, comparer, computed, configure, createAtom, apiDefineProperty as defineProperty, entries, extendObservable, flow, flowResult, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isObservableValue as isBoxedObservable, isComputed, isComputedProp, isFlow, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, makeAutoObservable, makeObservable, observable, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, override, apiOwnKeys as ownKeys, reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when };","map":{"version":3,"mappings":"AAAA,IAAMA,UAAU,GAAG;EACf,+FADe;EAEf,CAFe,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AAOC,6BAAP,KAAyC,QAA7C,EAAuD;EACnD;EACAA,6BAA6B,CAACC,UAA9B,CAAyC;IACrCnR,GAAG,EAAHA,GADqC;IAErCoR,MAAM,EAAE;MACJ7B,YAAY,EAAZA;IADI,CAF6B;IAKrC9nB,KAAK,EAALA;EALqC,CAAzC;AAOH","names":["niceErrors","annotationType","key","toString","index","length","other","constructor","name","dataStructure","thing","property","derivation","method","errors","process","die","error","args","e","apply","Error","map","String","join","mockGlobal","getGlobal","globalThis","window","global","self","assign","Object","getDescriptor","getOwnPropertyDescriptor","defineProperty","objectPrototype","prototype","EMPTY_ARRAY","freeze","EMPTY_OBJECT","hasProxy","Proxy","plainObjectString","assertProxies","warnAboutProxyRequirement","msg","globalState","verifyProxies","getNextId","mobxGuid","once","func","invoked","arguments","noop","isFunction","fn","isStringish","value","t","isObject","isPlainObject","proto","getPrototypeOf","protoConstructor","hasOwnProperty","call","isGenerator","obj","displayName","addHiddenProp","object","propName","enumerable","writable","configurable","addHiddenFinalProp","createInstanceofPredicate","theClass","x","isES6Map","Map","isES6Set","Set","hasGetOwnPropertySymbols","getOwnPropertySymbols","getPlainObjectKeys","keys","symbols","filter","propertyIsEnumerable","s","ownKeys","Reflect","getOwnPropertyNames","concat","stringifyKey","toPrimitive","hasProp","target","prop","getOwnPropertyDescriptors","res","forEach","storedAnnotationsSymbol","Symbol","createDecoratorAnnotation","annotation","decorator","storeAnnotation","isOverride","fieldName","assertNotDecorated","currentAnnotationType","annotationType_","requestedAnnotationType","collectStoredAnnotations","$mobx","Atom","name_","isPendingUnobservation_","isBeingObserved_","observers_","diffValue_","lastAccessedBy_","lowestObserverState_","IDerivationState_","NOT_TRACKING_","onBOL","onBUOL","_proto","onBO","listener","onBUO","reportObserved","reportChanged","startBatch","propagateChanged","endBatch","isAtom","createAtom","onBecomeObservedHandler","onBecomeUnobservedHandler","atom","onBecomeObserved","onBecomeUnobserved","identityComparer","a","b","structuralComparer","deepEqual","shallowComparer","defaultComparer","is","comparer","identity","structural","shallow","deepEnhancer","v","_","isObservable","Array","isArray","observable","array","undefined","set","isAction","isFlow","flow","autoAction","shallowEnhancer","isObservableObject","isObservableArray","isObservableMap","isObservableSet","deep","referenceEnhancer","newValue","refStructEnhancer","oldValue","OVERRIDE","override","make_","extend_","adm","isPlainObject_","appliedAnnotations_","descriptor","proxyTrap","createActionAnnotation","options","options_","source","_this$options_","bound","target_","actionDescriptor","createActionDescriptor","defineProperty_","assertActionDescriptor","safeDescriptors","_annotation$options_","bind","proxy_","createAction","_annotation$options_2","_annotation$options_3","createFlowAnnotation","flowDescriptor","createFlowDescriptor","_this$options_2","assertFlowDescriptor","isMobXFlow","createComputedAnnotation","assertComputedDescriptor","defineComputedProperty_","get","createObservableAnnotation","assertObservableDescriptor","defineObservableProperty_","enhancer","AUTO","autoAnnotation","createAutoAnnotation","computed","flowAnnotation","autoBind","actionAnnotation","observableAnnotation","ref","_this$options_4","_this$options_5","OBSERVABLE","OBSERVABLE_REF","OBSERVABLE_SHALLOW","OBSERVABLE_STRUCT","defaultCreateObservableOptions","defaultDecorator","proxy","asCreateObservableOptions","observableRefAnnotation","observableShallowAnnotation","observableStructAnnotation","observableDecoratorAnnotation","getEnhancerFromOptions","getEnhancerFromAnnotation","getAnnotationFromOptions","createObservable","arg2","arg3","box","observableFactories","o","ObservableValue","equals","initialValues","useProxies","createLegacyArray","createObservableArray","ObservableMap","ObservableSet","props","decorators","extendObservable","asObservableObject","asDynamicObservableObject","struct","COMPUTED","COMPUTED_STRUCT","computedAnnotation","computedStructAnnotation","arg1","opts","ComputedValue","currentActionId","nextActionId","isFunctionNameConfigurable","_getDescriptor","tmpNameDescriptor","actionName","executeAction","isMobxAction","canRunAsDerivation","scope","runInfo","_startAction","err","error_","_endAction","notifySpy_","isSpyEnabled","startTime_","Date","now","flattenedArgs","from","spyReportStart","type","ACTION","prevDerivation_","trackingDerivation","runAsAction","prevAllowStateChanges_","allowStateChanges","untrackedStart","allowStateChangesStart","prevAllowStateReads_","allowStateReadsStart","runAsAction_","actionId_","parentActionId_","suppressReactionErrors","allowStateChangesEnd","allowStateReadsEnd","untrackedEnd","spyReportEnd","time","prev","CREATE","_inheritsLoose","notifySpy","_this","hasUnreportedChange_","interceptors_","changeListeners_","value_","dehancer","spyReport","observableKind","debugObjectName","dehanceValue","prepareNewValue_","UNCHANGED","UPDATE","setNewValue_","checkIfStateModificationsAreAllowed","hasInterceptors","change","interceptChange","hasListeners","notifyListeners","intercept_","handler","registerInterceptor","observe_","fireImmediately","registerListener","raw","toJSON","valueOf","isObservableValue","dependenciesState_","observing_","newObserving_","runId_","UP_TO_DATE_","unboundDepsCount_","CaughtException","triggeredBy_","isComputing_","isRunningSetter_","setter_","isTracing_","TraceMode","NONE","scope_","equals_","requiresReaction_","keepAlive_","compareStructural","context","requiresReaction","keepAlive","onBecomeStale_","propagateMaybeChanged","inBatch","size","shouldCompute","warnAboutUntrackedRead_","computeValue_","prevTrackingContext","trackingContext","trackAndCompute","propagateChangeConfirmed","result","isCaughtException","cause","wasSuspended","changed","track","trackDerivedFunction","disableErrorBoundaries","suspend_","clearObserving","console","log","firstTime","prevValue","autorun","prevU","computedRequiresReaction","warn","isComputedValue","STALE_","POSSIBLY_STALE_","prevAllowStateReads","prevUntracked","obs","l","i","changeDependenciesStateTo0","isComputingDerivation","hasObservers","enforceActions","checkIfStateReadsAreAllowed","allowStateReads","observableRequiresReaction","f","runId","prevTracking","bindDependencies","warnAboutDerivationWithoutDependencies","requiresObservable_","reactionRequiresObservable","prevObserving","observing","lowestNewObservingDerivationState","i0","dep","removeObserver","addObserver","untracked","action","persistentKeys","MobXGlobals","version","pendingUnobservations","pendingReactions","isRunningReactions","spyListeners","globalReactionErrorHandlers","canMergeGlobalState","isolateCalled","__mobxInstanceCount","__mobxGlobals","setTimeout","isolateGlobalState","getGlobalState","resetGlobalState","defaultGlobals","indexOf","getObservers","node","add","queueForUnobservation","push","runReactions","list","d","logTraceInfo","BREAK","lines","printDepTree","getDependencyTree","Function","replace","tree","depth","repeat","dependencies","child","Reaction","onInvalidate_","errorHandler_","isDisposed_","isScheduled_","isTrackPending_","isRunning_","schedule_","isScheduled","runReaction_","reportExceptionInDerivation_","notify","startTime","prevReaction","message","dispose","getDisposer_","r","trace","enterBreakPoint","onReactionError","idx","splice","MAX_REACTION_ITERATIONS","reactionScheduler","runReactionsHelper","allReactions","iterations","remainingReactions","isReaction","setReactionScheduler","baseScheduler","event","listeners","END_EVENT","spy","ACTION_BOUND","AUTOACTION","AUTOACTION_BOUND","DEFAULT_ACTION_NAME","actionBoundAnnotation","autoActionAnnotation","autoActionBoundAnnotation","createActionFactory","runInAction","view","_opts","runSync","scheduler","delay","reaction","reactionRunner","onError","requiresObservable","createSchedulerFromOptions","run","expression","effect","effectAction","wrapErrorHandler","nextValue","errorHandler","baseFn","ON_BECOME_OBSERVED","ON_BECOME_UNOBSERVED","interceptHook","hook","getAtom","cb","listenersKey","hookListeners","NEVER","ALWAYS","OBSERVED","configure","ea","properties","annotations","descriptors","nodeToDependencyTree","unique","getObserverTree","nodeToObserverTree","observers","generatorId","FlowCancellationError","create","isFlowCancellationError","flowBoundAnnotation","generator","ctx","gen","rejector","pendingPromise","promise","Promise","resolve","reject","stepId","onFulfilled","ret","next","onRejected","then","done","cancel","cancelPromise","yieldedPromise","flowResult","interceptReads","propOrHandler","getAdministration","intercept","interceptProperty","interceptInterceptable","_isComputed","values_","has","isComputed","isComputedProp","_isObservable","isObservableProp","keys_","values","slice","entries","set_","parseInt","remove","delete_","has_","get_","apiDefineProperty","apiOwnKeys","ownKeys_","observe","propOrCb","cbOrFire","observeObservableProperty","observeObservable","cache","toJSHelper","__alreadySeen","toJS","pop","getAtomFromArgs","LOG","transaction","thisArg","when","predicate","whenPromise","_when","timeoutHandle","timeout","disposer","cond","clearTimeout","getAdm","objectProxyTraps","deleteProperty","preventExtensions","_target$$mobx","interceptable","interceptors","listenable","makeObservable","keysSymbol","makeAutoObservable","overrides","SPLICE","MAX_SPLICE_SIZE","arrayTraps","getArrayLength_","isNaN","arrayExtensions","setArrayLength_","ObservableArrayAdministration","owned_","legacyMode_","atom_","enhancer_","lastKnownLength_","newV","oldV","dehanceValue_","dehanceValues_","added","addedCount","removed","removedCount","newLength","currentLength","newItems","spliceWithArray_","updateArrayLength_","oldLength","delta","reserveArrayBuffer","deleteCount","Math","max","min","lengthDelta","spliceItemsIntoValues_","notifyArraySplice_","oldItems","notifyArrayChildUpdate_","owned","clear","spliceWithArray","items","shift","unshift","reverse","sort","copy","addArrayExtension","simpleFunc","mapLikeFunc","reduceLikeFunc","funcName","funcFactory","dehancedValues","callback","element","_this2","accumulator","currentValue","_this3","isObservableArrayAdministration","ObservableMapMarker","ADD","DELETE","iterator","toStringTag","initialData","data_","hasMap_","keysAtom_","merge","entry","newEntry","hasKey","updateValue_","addValue_","_this4","makeIterable","_this5","_this6","replacementMap","convertToMap","orderedData","keysReportChangedCalled","_this7","deleted","keyExisted","iter1","iter2","next1","next2","_createClass","ObservableSetMarker","callbackFn","nextIndex","observableValues","descriptorCache","REMOVE","ObservableObjectAdministration","defaultAnnotation_","pendingKeys_","isAnnotation","getObservablePropValue_","setObservablePropValue_","assertAnnotable","_this$target_$storedA","outcome","recordAnnotationApplied","deleteOutcome","notifyPropertyAddition_","cachedDescriptor","getCachedObservablePropDescriptor","getDebugName","isExtensible","isObservableObjectAdministration","_adm$target_$storedAn","ENTRY_0","createArrayEntryDescriptor","OBSERVABLE_ARRAY_BUFFER_SIZE","StubArray","inherit","ctor","setPrototypeOf","__proto__","LegacyObservableArray","arrays","createArrayBufferItem","named","eq","aStack","bStack","className","unwrap","areArrays","aCtor","bCtor","getSelf","g","m","__MOBX_DEVTOOLS_GLOBAL_HOOK__","injectMobx","extras"],"sources":["/data/messenger.client/node_modules/mobx/src/errors.ts","/data/messenger.client/node_modules/mobx/src/utils/global.ts","/data/messenger.client/node_modules/mobx/src/utils/utils.ts","/data/messenger.client/node_modules/mobx/src/api/decorators.ts","/data/messenger.client/node_modules/mobx/src/core/atom.ts","/data/messenger.client/node_modules/mobx/src/utils/comparer.ts","/data/messenger.client/node_modules/mobx/src/types/modifiers.ts","/data/messenger.client/node_modules/mobx/src/types/overrideannotation.ts","/data/messenger.client/node_modules/mobx/src/types/actionannotation.ts","/data/messenger.client/node_modules/mobx/src/types/flowannotation.ts","/data/messenger.client/node_modules/mobx/src/types/computedannotation.ts","/data/messenger.client/node_modules/mobx/src/types/observableannotation.ts","/data/messenger.client/node_modules/mobx/src/types/autoannotation.ts","/data/messenger.client/node_modules/mobx/src/api/observable.ts","/data/messenger.client/node_modules/mobx/src/api/computed.ts","/data/messenger.client/node_modules/mobx/src/core/action.ts","/data/messenger.client/node_modules/mobx/src/types/observablevalue.ts","/data/messenger.client/node_modules/mobx/src/core/computedvalue.ts","/data/messenger.client/node_modules/mobx/src/core/derivation.ts","/data/messenger.client/node_modules/mobx/src/core/globalstate.ts","/data/messenger.client/node_modules/mobx/src/core/observable.ts","/data/messenger.client/node_modules/mobx/src/core/reaction.ts","/data/messenger.client/node_modules/mobx/src/core/spy.ts","/data/messenger.client/node_modules/mobx/src/api/action.ts","/data/messenger.client/node_modules/mobx/src/api/autorun.ts","/data/messenger.client/node_modules/mobx/src/api/become-observed.ts","/data/messenger.client/node_modules/mobx/src/api/configure.ts","/data/messenger.client/node_modules/mobx/src/api/extendobservable.ts","/data/messenger.client/node_modules/mobx/src/api/extras.ts","/data/messenger.client/node_modules/mobx/src/api/flow.ts","/data/messenger.client/node_modules/mobx/src/api/intercept-read.ts","/data/messenger.client/node_modules/mobx/src/api/intercept.ts","/data/messenger.client/node_modules/mobx/src/api/iscomputed.ts","/data/messenger.client/node_modules/mobx/src/api/isobservable.ts","/data/messenger.client/node_modules/mobx/src/api/object-api.ts","/data/messenger.client/node_modules/mobx/src/api/observe.ts","/data/messenger.client/node_modules/mobx/src/api/tojs.ts","/data/messenger.client/node_modules/mobx/src/api/trace.ts","/data/messenger.client/node_modules/mobx/src/api/transaction.ts","/data/messenger.client/node_modules/mobx/src/api/when.ts","/data/messenger.client/node_modules/mobx/src/types/dynamicobject.ts","/data/messenger.client/node_modules/mobx/src/types/intercept-utils.ts","/data/messenger.client/node_modules/mobx/src/types/listen-utils.ts","/data/messenger.client/node_modules/mobx/src/api/makeObservable.ts","/data/messenger.client/node_modules/mobx/src/types/observablearray.ts","/data/messenger.client/node_modules/mobx/src/types/observablemap.ts","/data/messenger.client/node_modules/mobx/src/types/observableset.ts","/data/messenger.client/node_modules/mobx/src/types/observableobject.ts","/data/messenger.client/node_modules/mobx/src/types/legacyobservablearray.ts","/data/messenger.client/node_modules/mobx/src/types/type-utils.ts","/data/messenger.client/node_modules/mobx/src/utils/eq.ts","/data/messenger.client/node_modules/mobx/src/utils/iterable.ts","/data/messenger.client/node_modules/mobx/src/api/annotation.ts","/data/messenger.client/node_modules/mobx/src/mobx.ts"],"sourcesContent":["const niceErrors = {\n    0: `Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'`,\n    1(annotationType, key: PropertyKey) {\n        return `Cannot apply '${annotationType}' to '${key.toString()}': Field not found.`\n    },\n    /*\n    2(prop) {\n        return `invalid decorator for '${prop.toString()}'`\n    },\n    3(prop) {\n        return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\n    },\n    4(prop) {\n        return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\n    },\n    */\n    5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n    6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n    7: \"'entries()' can only be used on observable objects, arrays and maps\",\n    8: \"'set()' can only be used on observable objects, arrays and maps\",\n    9: \"'remove()' can only be used on observable objects, arrays and maps\",\n    10: \"'has()' can only be used on observable objects, arrays and maps\",\n    11: \"'get()' can only be used on observable objects, arrays and maps\",\n    12: `Invalid annotation`,\n    13: `Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)`,\n    14: \"Intercept handlers should return nothing or a change object\",\n    15: `Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)`,\n    16: `Modification exception: the internal structure of an observable array was changed.`,\n    17(index, length) {\n        return `[mobx.array] Index out of bounds, ${index} is larger than ${length}`\n    },\n    18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n    19(other) {\n        return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name\n    },\n    20(other) {\n        return \"Cannot initialize map from \" + other\n    },\n    21(dataStructure) {\n        return `Cannot convert to map from '${dataStructure}'`\n    },\n    22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n    23: \"It is not possible to get index atoms from arrays\",\n    24(thing) {\n        return \"Cannot obtain administration from \" + thing\n    },\n    25(property, name) {\n        return `the entry '${property}' does not exist in the observable map '${name}'`\n    },\n    26: \"please specify a property\",\n    27(property, name) {\n        return `no observable property '${property.toString()}' found on the observable object '${name}'`\n    },\n    28(thing) {\n        return \"Cannot obtain atom from \" + thing\n    },\n    29: \"Expecting some object\",\n    30: \"invalid action stack. did you forget to finish an action?\",\n    31: \"missing option for computed: get\",\n    32(name, derivation) {\n        return `Cycle detected in computation ${name}: ${derivation}`\n    },\n    33(name) {\n        return `The setter of computed value '${name}' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?`\n    },\n    34(name) {\n        return `[ComputedValue '${name}'] It is not possible to assign a new value to a computed value.`\n    },\n    35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n    36: \"isolateGlobalState should be called before MobX is running any reactions\",\n    37(method) {\n        return `[mobx] \\`observableArray.${method}()\\` mutates the array in-place, which is not allowed inside a derivation. Use \\`array.slice().${method}()\\` instead`\n    },\n    38: \"'ownKeys()' can only be used on observable objects\",\n    39: \"'defineProperty()' can only be used on observable objects\"\n} as const\n\nconst errors: typeof niceErrors = __DEV__ ? niceErrors : ({} as any)\n\nexport function die(error: string | keyof typeof errors, ...args: any[]): never {\n    if (__DEV__) {\n        let e: any = typeof error === \"string\" ? error : errors[error]\n        if (typeof e === \"function\") e = e.apply(null, args as any)\n        throw new Error(`[MobX] ${e}`)\n    }\n    throw new Error(\n        typeof error === \"number\"\n            ? `[MobX] minified error nr: ${error}${\n                  args.length ? \" \" + args.map(String).join(\",\") : \"\"\n              }. Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts`\n            : `[MobX] ${error}`\n    )\n}\n","declare const window: any\ndeclare const self: any\n\nconst mockGlobal = {}\n\nexport function getGlobal() {\n    if (typeof globalThis !== \"undefined\") {\n        return globalThis\n    }\n    if (typeof window !== \"undefined\") {\n        return window\n    }\n    if (typeof global !== \"undefined\") {\n        return global\n    }\n    if (typeof self !== \"undefined\") {\n        return self\n    }\n    return mockGlobal\n}\n","import { globalState, die } from \"../internal\"\n\n// We shorten anything used > 5 times\nexport const assign = Object.assign\nexport const getDescriptor = Object.getOwnPropertyDescriptor\nexport const defineProperty = Object.defineProperty\nexport const objectPrototype = Object.prototype\n\nexport const EMPTY_ARRAY = []\nObject.freeze(EMPTY_ARRAY)\n\nexport const EMPTY_OBJECT = {}\nObject.freeze(EMPTY_OBJECT)\n\nexport interface Lambda {\n    (): void\n    name?: string\n}\n\nconst hasProxy = typeof Proxy !== \"undefined\"\nconst plainObjectString = Object.toString()\n\nexport function assertProxies() {\n    if (!hasProxy) {\n        die(\n            __DEV__\n                ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\"\n                : \"Proxy not available\"\n        )\n    }\n}\n\nexport function warnAboutProxyRequirement(msg: string) {\n    if (__DEV__ && globalState.verifyProxies) {\n        die(\n            \"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" +\n                msg\n        )\n    }\n}\n\nexport function getNextId() {\n    return ++globalState.mobxGuid\n}\n\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nexport function once(func: Lambda): Lambda {\n    let invoked = false\n    return function () {\n        if (invoked) {\n            return\n        }\n        invoked = true\n        return (func as any).apply(this, arguments)\n    }\n}\n\nexport const noop = () => {}\n\nexport function isFunction(fn: any): fn is Function {\n    return typeof fn === \"function\"\n}\n\nexport function isString(value: any): value is string {\n    return typeof value === \"string\"\n}\n\nexport function isStringish(value: any): value is string | number | symbol {\n    const t = typeof value\n    switch (t) {\n        case \"string\":\n        case \"symbol\":\n        case \"number\":\n            return true\n    }\n    return false\n}\n\nexport function isObject(value: any): value is Object {\n    return value !== null && typeof value === \"object\"\n}\n\nexport function isPlainObject(value: any) {\n    if (!isObject(value)) {\n        return false\n    }\n    const proto = Object.getPrototypeOf(value)\n    if (proto == null) {\n        return true\n    }\n    const protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n    return (\n        typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString\n    )\n}\n\n// https://stackoverflow.com/a/37865170\nexport function isGenerator(obj: any): boolean {\n    const constructor = obj?.constructor\n    if (!constructor) {\n        return false\n    }\n    if (\n        \"GeneratorFunction\" === constructor.name ||\n        \"GeneratorFunction\" === constructor.displayName\n    ) {\n        return true\n    }\n    return false\n}\n\nexport function addHiddenProp(object: any, propName: PropertyKey, value: any) {\n    defineProperty(object, propName, {\n        enumerable: false,\n        writable: true,\n        configurable: true,\n        value\n    })\n}\n\nexport function addHiddenFinalProp(object: any, propName: PropertyKey, value: any) {\n    defineProperty(object, propName, {\n        enumerable: false,\n        writable: false,\n        configurable: true,\n        value\n    })\n}\n\nexport function createInstanceofPredicate<T>(\n    name: string,\n    theClass: new (...args: any[]) => T\n): (x: any) => x is T {\n    const propName = \"isMobX\" + name\n    theClass.prototype[propName] = true\n    return function (x) {\n        return isObject(x) && x[propName] === true\n    } as any\n}\n\nexport function isES6Map(thing: any): thing is Map<any, any> {\n    return thing instanceof Map\n}\n\nexport function isES6Set(thing: any): thing is Set<any> {\n    return thing instanceof Set\n}\n\nconst hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\"\n\n/**\n * Returns the following: own enumerable keys and symbols.\n */\nexport function getPlainObjectKeys(object: any) {\n    const keys = Object.keys(object)\n    // Not supported in IE, so there are not going to be symbol props anyway...\n    if (!hasGetOwnPropertySymbols) {\n        return keys\n    }\n    const symbols = Object.getOwnPropertySymbols(object)\n    if (!symbols.length) {\n        return keys\n    }\n    return [...keys, ...symbols.filter(s => objectPrototype.propertyIsEnumerable.call(object, s))]\n}\n\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nexport const ownKeys: (target: any) => Array<string | symbol> =\n    typeof Reflect !== \"undefined\" && Reflect.ownKeys\n        ? Reflect.ownKeys\n        : hasGetOwnPropertySymbols\n        ? obj => Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj) as any)\n        : /* istanbul ignore next */ Object.getOwnPropertyNames\n\nexport function stringifyKey(key: any): string {\n    if (typeof key === \"string\") {\n        return key\n    }\n    if (typeof key === \"symbol\") {\n        return key.toString()\n    }\n    return new String(key).toString()\n}\n\nexport function toPrimitive(value: any) {\n    return value === null ? null : typeof value === \"object\" ? \"\" + value : value\n}\n\nexport function hasProp(target: Object, prop: PropertyKey): boolean {\n    return objectPrototype.hasOwnProperty.call(target, prop)\n}\n\n// From Immer utils\nexport const getOwnPropertyDescriptors =\n    Object.getOwnPropertyDescriptors ||\n    function getOwnPropertyDescriptors(target: any) {\n        // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n        const res: any = {}\n        // Note: without polyfill for ownKeys, symbols won't be picked up\n        ownKeys(target).forEach(key => {\n            res[key] = getDescriptor(target, key)\n        })\n        return res\n    }\n","import { Annotation, addHiddenProp, AnnotationsMap, hasProp, die, isOverride } from \"../internal\"\n\nexport const storedAnnotationsSymbol = Symbol(\"mobx-stored-annotations\")\n\n/**\n * Creates a function that acts as\n * - decorator\n * - annotation object\n */\nexport function createDecoratorAnnotation(annotation: Annotation): PropertyDecorator & Annotation {\n    function decorator(target, property) {\n        storeAnnotation(target, property, annotation)\n    }\n    return Object.assign(decorator, annotation)\n}\n\n/**\n * Stores annotation to prototype,\n * so it can be inspected later by `makeObservable` called from constructor\n */\nexport function storeAnnotation(prototype: any, key: PropertyKey, annotation: Annotation) {\n    if (!hasProp(prototype, storedAnnotationsSymbol)) {\n        addHiddenProp(prototype, storedAnnotationsSymbol, {\n            // Inherit annotations\n            ...prototype[storedAnnotationsSymbol]\n        })\n    }\n    // @override must override something\n    if (__DEV__ && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n        const fieldName = `${prototype.constructor.name}.prototype.${key.toString()}`\n        die(\n            `'${fieldName}' is decorated with 'override', ` +\n                `but no such decorated member was found on prototype.`\n        )\n    }\n    // Cannot re-decorate\n    assertNotDecorated(prototype, annotation, key)\n\n    // Ignore override\n    if (!isOverride(annotation)) {\n        prototype[storedAnnotationsSymbol][key] = annotation\n    }\n}\n\nfunction assertNotDecorated(prototype: object, annotation: Annotation, key: PropertyKey) {\n    if (__DEV__ && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n        const fieldName = `${prototype.constructor.name}.prototype.${key.toString()}`\n        const currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_\n        const requestedAnnotationType = annotation.annotationType_\n        die(\n            `Cannot apply '@${requestedAnnotationType}' to '${fieldName}':` +\n                `\\nThe field is already decorated with '@${currentAnnotationType}'.` +\n                `\\nRe-decorating fields is not allowed.` +\n                `\\nUse '@override' decorator for methods overridden by subclass.`\n        )\n    }\n}\n\n/**\n * Collects annotations from prototypes and stores them on target (instance)\n */\nexport function collectStoredAnnotations(target): AnnotationsMap<any, any> {\n    if (!hasProp(target, storedAnnotationsSymbol)) {\n        if (__DEV__ && !target[storedAnnotationsSymbol]) {\n            die(\n                `No annotations were passed to makeObservable, but no decorated members have been found either`\n            )\n        }\n        // We need a copy as we will remove annotation from the list once it's applied.\n        addHiddenProp(target, storedAnnotationsSymbol, { ...target[storedAnnotationsSymbol] })\n    }\n    return target[storedAnnotationsSymbol]\n}\n","import {\n    IDerivationState_,\n    IObservable,\n    IDerivation,\n    createInstanceofPredicate,\n    endBatch,\n    getNextId,\n    noop,\n    onBecomeObserved,\n    onBecomeUnobserved,\n    propagateChanged,\n    reportObserved,\n    startBatch,\n    Lambda\n} from \"../internal\"\n\nexport const $mobx = Symbol(\"mobx administration\")\n\nexport interface IAtom extends IObservable {\n    reportObserved(): boolean\n    reportChanged()\n}\n\nexport class Atom implements IAtom {\n    isPendingUnobservation_ = false // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n    isBeingObserved_ = false\n    observers_ = new Set<IDerivation>()\n\n    diffValue_ = 0\n    lastAccessedBy_ = 0\n    lowestObserverState_ = IDerivationState_.NOT_TRACKING_\n    /**\n     * Create a new atom. For debugging purposes it is recommended to give it a name.\n     * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n     */\n    constructor(public name_ = __DEV__ ? \"Atom@\" + getNextId() : \"Atom\") {}\n\n    // onBecomeObservedListeners\n    public onBOL: Set<Lambda> | undefined\n    // onBecomeUnobservedListeners\n    public onBUOL: Set<Lambda> | undefined\n\n    public onBO() {\n        if (this.onBOL) {\n            this.onBOL.forEach(listener => listener())\n        }\n    }\n\n    public onBUO() {\n        if (this.onBUOL) {\n            this.onBUOL.forEach(listener => listener())\n        }\n    }\n\n    /**\n     * Invoke this method to notify mobx that your atom has been used somehow.\n     * Returns true if there is currently a reactive context.\n     */\n    public reportObserved(): boolean {\n        return reportObserved(this)\n    }\n\n    /**\n     * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n     */\n    public reportChanged() {\n        startBatch()\n        propagateChanged(this)\n        endBatch()\n    }\n\n    toString() {\n        return this.name_\n    }\n}\n\nexport const isAtom = createInstanceofPredicate(\"Atom\", Atom)\n\nexport function createAtom(\n    name: string,\n    onBecomeObservedHandler: () => void = noop,\n    onBecomeUnobservedHandler: () => void = noop\n): IAtom {\n    const atom = new Atom(name)\n    // default `noop` listener will not initialize the hook Set\n    if (onBecomeObservedHandler !== noop) {\n        onBecomeObserved(atom, onBecomeObservedHandler)\n    }\n\n    if (onBecomeUnobservedHandler !== noop) {\n        onBecomeUnobserved(atom, onBecomeUnobservedHandler)\n    }\n    return atom\n}\n","import { deepEqual } from \"../internal\"\n\nexport interface IEqualsComparer<T> {\n    (a: T, b: T): boolean\n}\n\nfunction identityComparer(a: any, b: any): boolean {\n    return a === b\n}\n\nfunction structuralComparer(a: any, b: any): boolean {\n    return deepEqual(a, b)\n}\n\nfunction shallowComparer(a: any, b: any): boolean {\n    return deepEqual(a, b, 1)\n}\n\nfunction defaultComparer(a: any, b: any): boolean {\n    if (Object.is) {\n        return Object.is(a, b)\n    }\n\n    return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b\n}\n\nexport const comparer = {\n    identity: identityComparer,\n    structural: structuralComparer,\n    default: defaultComparer,\n    shallow: shallowComparer\n}\n","import {\n    deepEqual,\n    isES6Map,\n    isES6Set,\n    isObservable,\n    isObservableArray,\n    isObservableMap,\n    isObservableSet,\n    isObservableObject,\n    isPlainObject,\n    observable,\n    die,\n    isAction,\n    autoAction,\n    flow,\n    isFlow,\n    isGenerator\n} from \"../internal\"\n\nexport interface IEnhancer<T> {\n    (newValue: T, oldValue: T | undefined, name: string): T\n}\n\nexport function deepEnhancer(v, _, name) {\n    // it is an observable already, done\n    if (isObservable(v)) {\n        return v\n    }\n\n    // something that can be converted and mutated?\n    if (Array.isArray(v)) {\n        return observable.array(v, { name })\n    }\n    if (isPlainObject(v)) {\n        return observable.object(v, undefined, { name })\n    }\n    if (isES6Map(v)) {\n        return observable.map(v, { name })\n    }\n    if (isES6Set(v)) {\n        return observable.set(v, { name })\n    }\n    if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n        if (isGenerator(v)) {\n            return flow(v)\n        } else {\n            return autoAction(name, v)\n        }\n    }\n    return v\n}\n\nexport function shallowEnhancer(v, _, name): any {\n    if (v === undefined || v === null) {\n        return v\n    }\n    if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n        return v\n    }\n    if (Array.isArray(v)) {\n        return observable.array(v, { name, deep: false })\n    }\n    if (isPlainObject(v)) {\n        return observable.object(v, undefined, { name, deep: false })\n    }\n    if (isES6Map(v)) {\n        return observable.map(v, { name, deep: false })\n    }\n    if (isES6Set(v)) {\n        return observable.set(v, { name, deep: false })\n    }\n\n    if (__DEV__) {\n        die(\n            \"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\"\n        )\n    }\n}\n\nexport function referenceEnhancer(newValue?) {\n    // never turn into an observable\n    return newValue\n}\n\nexport function refStructEnhancer(v, oldValue): any {\n    if (__DEV__ && isObservable(v)) {\n        die(`observable.struct should not be used with observable values`)\n    }\n    if (deepEqual(v, oldValue)) {\n        return oldValue\n    }\n    return v\n}\n","import {\n    die,\n    Annotation,\n    hasProp,\n    createDecoratorAnnotation,\n    ObservableObjectAdministration,\n    MakeResult\n} from \"../internal\"\n\nconst OVERRIDE = \"override\"\n\nexport const override: Annotation & PropertyDecorator = createDecoratorAnnotation({\n    annotationType_: OVERRIDE,\n    make_,\n    extend_\n})\n\nexport function isOverride(annotation: Annotation): boolean {\n    return annotation.annotationType_ === OVERRIDE\n}\n\nfunction make_(adm: ObservableObjectAdministration, key): MakeResult {\n    // Must not be plain object\n    if (__DEV__ && adm.isPlainObject_) {\n        die(\n            `Cannot apply '${this.annotationType_}' to '${adm.name_}.${key.toString()}':` +\n                `\\n'${this.annotationType_}' cannot be used on plain objects.`\n        )\n    }\n    // Must override something\n    if (__DEV__ && !hasProp(adm.appliedAnnotations_!, key)) {\n        die(\n            `'${adm.name_}.${key.toString()}' is annotated with '${this.annotationType_}', ` +\n                `but no such annotated member was found on prototype.`\n        )\n    }\n    return MakeResult.Cancel\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap): boolean {\n    die(`'${this.annotationType_}' can only be used with 'makeObservable'`)\n}\n","import {\n    ObservableObjectAdministration,\n    createAction,\n    isAction,\n    defineProperty,\n    die,\n    isFunction,\n    Annotation,\n    globalState,\n    MakeResult\n} from \"../internal\"\n\nexport function createActionAnnotation(name: string, options?: object): Annotation {\n    return {\n        annotationType_: name,\n        options_: options,\n        make_,\n        extend_\n    }\n}\n\nfunction make_(\n    adm: ObservableObjectAdministration,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor,\n    source: object\n): MakeResult {\n    // bound\n    if (this.options_?.bound) {\n        return this.extend_(adm, key, descriptor, false) === null\n            ? MakeResult.Cancel\n            : MakeResult.Break\n    }\n    // own\n    if (source === adm.target_) {\n        return this.extend_(adm, key, descriptor, false) === null\n            ? MakeResult.Cancel\n            : MakeResult.Continue\n    }\n    // prototype\n    if (isAction(descriptor.value)) {\n        // A prototype could have been annotated already by other constructor,\n        // rest of the proto chain must be annotated already\n        return MakeResult.Break\n    }\n    const actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false)\n    defineProperty(source, key, actionDescriptor)\n    return MakeResult.Continue\n}\n\nfunction extend_(\n    adm: ObservableObjectAdministration,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor,\n    proxyTrap: boolean\n): boolean | null {\n    const actionDescriptor = createActionDescriptor(adm, this, key, descriptor)\n    return adm.defineProperty_(key, actionDescriptor, proxyTrap)\n}\n\nfunction assertActionDescriptor(\n    adm: ObservableObjectAdministration,\n    { annotationType_ }: Annotation,\n    key: PropertyKey,\n    { value }: PropertyDescriptor\n) {\n    if (__DEV__ && !isFunction(value)) {\n        die(\n            `Cannot apply '${annotationType_}' to '${adm.name_}.${key.toString()}':` +\n                `\\n'${annotationType_}' can only be used on properties with a function value.`\n        )\n    }\n}\n\nexport function createActionDescriptor(\n    adm: ObservableObjectAdministration,\n    annotation: Annotation,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor,\n    // provides ability to disable safeDescriptors for prototypes\n    safeDescriptors: boolean = globalState.safeDescriptors\n) {\n    assertActionDescriptor(adm, annotation, key, descriptor)\n    let { value } = descriptor\n    if (annotation.options_?.bound) {\n        value = value.bind(adm.proxy_ ?? adm.target_)\n    }\n    return {\n        value: createAction(\n            annotation.options_?.name ?? key.toString(),\n            value,\n            annotation.options_?.autoAction ?? false,\n            // https://github.com/mobxjs/mobx/discussions/3140\n            annotation.options_?.bound ? adm.proxy_ ?? adm.target_ : undefined\n        ),\n        // Non-configurable for classes\n        // prevents accidental field redefinition in subclass\n        configurable: safeDescriptors ? adm.isPlainObject_ : true,\n        // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n        enumerable: false,\n        // Non-obsevable, therefore non-writable\n        // Also prevents rewriting in subclass constructor\n        writable: safeDescriptors ? false : true\n    }\n}\n","import {\n    ObservableObjectAdministration,\n    Annotation,\n    defineProperty,\n    die,\n    flow,\n    isFlow,\n    isFunction,\n    globalState,\n    MakeResult,\n    hasProp\n} from \"../internal\"\n\nexport function createFlowAnnotation(name: string, options?: object): Annotation {\n    return {\n        annotationType_: name,\n        options_: options,\n        make_,\n        extend_\n    }\n}\n\nfunction make_(\n    adm: ObservableObjectAdministration,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor,\n    source: object\n): MakeResult {\n    // own\n    if (source === adm.target_) {\n        return this.extend_(adm, key, descriptor, false) === null\n            ? MakeResult.Cancel\n            : MakeResult.Continue\n    }\n    // prototype\n    // bound - must annotate protos to support super.flow()\n    if (this.options_?.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n        if (this.extend_(adm, key, descriptor, false) === null) {\n            return MakeResult.Cancel\n        }\n    }\n    if (isFlow(descriptor.value)) {\n        // A prototype could have been annotated already by other constructor,\n        // rest of the proto chain must be annotated already\n        return MakeResult.Break\n    }\n    const flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false)\n    defineProperty(source, key, flowDescriptor)\n    return MakeResult.Continue\n}\n\nfunction extend_(\n    adm: ObservableObjectAdministration,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor,\n    proxyTrap: boolean\n): boolean | null {\n    const flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, this.options_?.bound)\n    return adm.defineProperty_(key, flowDescriptor, proxyTrap)\n}\n\nfunction assertFlowDescriptor(\n    adm: ObservableObjectAdministration,\n    { annotationType_ }: Annotation,\n    key: PropertyKey,\n    { value }: PropertyDescriptor\n) {\n    if (__DEV__ && !isFunction(value)) {\n        die(\n            `Cannot apply '${annotationType_}' to '${adm.name_}.${key.toString()}':` +\n                `\\n'${annotationType_}' can only be used on properties with a generator function value.`\n        )\n    }\n}\n\nfunction createFlowDescriptor(\n    adm: ObservableObjectAdministration,\n    annotation: Annotation,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor,\n    bound: boolean,\n    // provides ability to disable safeDescriptors for prototypes\n    safeDescriptors: boolean = globalState.safeDescriptors\n): PropertyDescriptor {\n    assertFlowDescriptor(adm, annotation, key, descriptor)\n    let { value } = descriptor\n    // In case of flow.bound, the descriptor can be from already annotated prototype\n    if (!isFlow(value)) {\n        value = flow(value)\n    }\n    if (bound) {\n        // We do not keep original function around, so we bind the existing flow\n        value = value.bind(adm.proxy_ ?? adm.target_)\n        // This is normally set by `flow`, but `bind` returns new function...\n        value.isMobXFlow = true\n    }\n    return {\n        value,\n        // Non-configurable for classes\n        // prevents accidental field redefinition in subclass\n        configurable: safeDescriptors ? adm.isPlainObject_ : true,\n        // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n        enumerable: false,\n        // Non-obsevable, therefore non-writable\n        // Also prevents rewriting in subclass constructor\n        writable: safeDescriptors ? false : true\n    }\n}\n","import { ObservableObjectAdministration, die, Annotation, MakeResult } from \"../internal\"\n\nexport function createComputedAnnotation(name: string, options?: object): Annotation {\n    return {\n        annotationType_: name,\n        options_: options,\n        make_,\n        extend_\n    }\n}\n\nfunction make_(\n    adm: ObservableObjectAdministration,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor\n): MakeResult {\n    return this.extend_(adm, key, descriptor, false) === null ? MakeResult.Cancel : MakeResult.Break\n}\n\nfunction extend_(\n    adm: ObservableObjectAdministration,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor,\n    proxyTrap: boolean\n): boolean | null {\n    assertComputedDescriptor(adm, this, key, descriptor)\n    return adm.defineComputedProperty_(\n        key,\n        {\n            ...this.options_,\n            get: descriptor.get,\n            set: descriptor.set\n        },\n        proxyTrap\n    )\n}\n\nfunction assertComputedDescriptor(\n    adm: ObservableObjectAdministration,\n    { annotationType_ }: Annotation,\n    key: PropertyKey,\n    { get }: PropertyDescriptor\n) {\n    if (__DEV__ && !get) {\n        die(\n            `Cannot apply '${annotationType_}' to '${adm.name_}.${key.toString()}':` +\n                `\\n'${annotationType_}' can only be used on getter(+setter) properties.`\n        )\n    }\n}\n","import {\n    ObservableObjectAdministration,\n    deepEnhancer,\n    die,\n    Annotation,\n    MakeResult\n} from \"../internal\"\n\nexport function createObservableAnnotation(name: string, options?: object): Annotation {\n    return {\n        annotationType_: name,\n        options_: options,\n        make_,\n        extend_\n    }\n}\n\nfunction make_(\n    adm: ObservableObjectAdministration,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor\n): MakeResult {\n    return this.extend_(adm, key, descriptor, false) === null ? MakeResult.Cancel : MakeResult.Break\n}\n\nfunction extend_(\n    adm: ObservableObjectAdministration,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor,\n    proxyTrap: boolean\n): boolean | null {\n    assertObservableDescriptor(adm, this, key, descriptor)\n    return adm.defineObservableProperty_(\n        key,\n        descriptor.value,\n        this.options_?.enhancer ?? deepEnhancer,\n        proxyTrap\n    )\n}\n\nfunction assertObservableDescriptor(\n    adm: ObservableObjectAdministration,\n    { annotationType_ }: Annotation,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor\n) {\n    if (__DEV__ && !(\"value\" in descriptor)) {\n        die(\n            `Cannot apply '${annotationType_}' to '${adm.name_}.${key.toString()}':` +\n                `\\n'${annotationType_}' cannot be used on getter/setter properties`\n        )\n    }\n}\n","import {\n    ObservableObjectAdministration,\n    observable,\n    Annotation,\n    defineProperty,\n    createAction,\n    globalState,\n    flow,\n    computed,\n    autoAction,\n    isGenerator,\n    MakeResult\n} from \"../internal\"\n\nconst AUTO = \"true\"\n\nexport const autoAnnotation: Annotation = createAutoAnnotation()\n\nexport function createAutoAnnotation(options?: object): Annotation {\n    return {\n        annotationType_: AUTO,\n        options_: options,\n        make_,\n        extend_\n    }\n}\n\nfunction make_(\n    adm: ObservableObjectAdministration,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor,\n    source: object\n): MakeResult {\n    // getter -> computed\n    if (descriptor.get) {\n        return computed.make_(adm, key, descriptor, source)\n    }\n    // lone setter -> action setter\n    if (descriptor.set) {\n        // TODO make action applicable to setter and delegate to action.make_\n        const set = createAction(key.toString(), descriptor.set) as (v: any) => void\n        // own\n        if (source === adm.target_) {\n            return adm.defineProperty_(key, {\n                configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n                set\n            }) === null\n                ? MakeResult.Cancel\n                : MakeResult.Continue\n        }\n        // proto\n        defineProperty(source, key, {\n            configurable: true,\n            set\n        })\n        return MakeResult.Continue\n    }\n    // function on proto -> autoAction/flow\n    if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n        if (isGenerator(descriptor.value)) {\n            const flowAnnotation = this.options_?.autoBind ? flow.bound : flow\n            return flowAnnotation.make_(adm, key, descriptor, source)\n        }\n        const actionAnnotation = this.options_?.autoBind ? autoAction.bound : autoAction\n        return actionAnnotation.make_(adm, key, descriptor, source)\n    }\n    // other -> observable\n    // Copy props from proto as well, see test:\n    // \"decorate should work with Object.create\"\n    let observableAnnotation = this.options_?.deep === false ? observable.ref : observable\n    // if function respect autoBind option\n    if (typeof descriptor.value === \"function\" && this.options_?.autoBind) {\n        descriptor.value = descriptor.value.bind(adm.proxy_ ?? adm.target_)\n    }\n    return observableAnnotation.make_(adm, key, descriptor, source)\n}\n\nfunction extend_(\n    adm: ObservableObjectAdministration,\n    key: PropertyKey,\n    descriptor: PropertyDescriptor,\n    proxyTrap: boolean\n): boolean | null {\n    // getter -> computed\n    if (descriptor.get) {\n        return computed.extend_(adm, key, descriptor, proxyTrap)\n    }\n    // lone setter -> action setter\n    if (descriptor.set) {\n        // TODO make action applicable to setter and delegate to action.extend_\n        return adm.defineProperty_(\n            key,\n            {\n                configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n                set: createAction(key.toString(), descriptor.set) as (v: any) => void\n            },\n            proxyTrap\n        )\n    }\n    // other -> observable\n    // if function respect autoBind option\n    if (typeof descriptor.value === \"function\" && this.options_?.autoBind) {\n        descriptor.value = descriptor.value.bind(adm.proxy_ ?? adm.target_)\n    }\n    let observableAnnotation = this.options_?.deep === false ? observable.ref : observable\n    return observableAnnotation.extend_(adm, key, descriptor, proxyTrap)\n}\n","import {\n    IEnhancer,\n    IEqualsComparer,\n    IObservableArray,\n    IObservableMapInitialValues,\n    IObservableSetInitialValues,\n    IObservableValue,\n    ObservableMap,\n    ObservableSet,\n    ObservableValue,\n    asDynamicObservableObject,\n    createObservableArray,\n    deepEnhancer,\n    extendObservable,\n    isES6Map,\n    isES6Set,\n    isObservable,\n    isPlainObject,\n    referenceEnhancer,\n    Annotation,\n    shallowEnhancer,\n    refStructEnhancer,\n    AnnotationsMap,\n    asObservableObject,\n    storeAnnotation,\n    createDecoratorAnnotation,\n    createLegacyArray,\n    globalState,\n    assign,\n    isStringish,\n    createObservableAnnotation,\n    createAutoAnnotation\n} from \"../internal\"\n\nexport const OBSERVABLE = \"observable\"\nexport const OBSERVABLE_REF = \"observable.ref\"\nexport const OBSERVABLE_SHALLOW = \"observable.shallow\"\nexport const OBSERVABLE_STRUCT = \"observable.struct\"\n\nexport type CreateObservableOptions = {\n    name?: string\n    equals?: IEqualsComparer<any>\n    deep?: boolean\n    defaultDecorator?: Annotation\n    proxy?: boolean\n    autoBind?: boolean\n}\n\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nexport const defaultCreateObservableOptions: CreateObservableOptions = {\n    deep: true,\n    name: undefined,\n    defaultDecorator: undefined,\n    proxy: true\n}\nObject.freeze(defaultCreateObservableOptions)\n\nexport function asCreateObservableOptions(thing: any): CreateObservableOptions {\n    return thing || defaultCreateObservableOptions\n}\n\nconst observableAnnotation = createObservableAnnotation(OBSERVABLE)\nconst observableRefAnnotation = createObservableAnnotation(OBSERVABLE_REF, {\n    enhancer: referenceEnhancer\n})\nconst observableShallowAnnotation = createObservableAnnotation(OBSERVABLE_SHALLOW, {\n    enhancer: shallowEnhancer\n})\nconst observableStructAnnotation = createObservableAnnotation(OBSERVABLE_STRUCT, {\n    enhancer: refStructEnhancer\n})\nconst observableDecoratorAnnotation = createDecoratorAnnotation(observableAnnotation)\n\nexport function getEnhancerFromOptions(options: CreateObservableOptions): IEnhancer<any> {\n    return options.deep === true\n        ? deepEnhancer\n        : options.deep === false\n        ? referenceEnhancer\n        : getEnhancerFromAnnotation(options.defaultDecorator)\n}\n\nexport function getAnnotationFromOptions(\n    options?: CreateObservableOptions\n): Annotation | undefined {\n    return options ? options.defaultDecorator ?? createAutoAnnotation(options) : undefined\n}\n\nexport function getEnhancerFromAnnotation(annotation?: Annotation): IEnhancer<any> {\n    return !annotation ? deepEnhancer : annotation.options_?.enhancer ?? deepEnhancer\n}\n\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v: any, arg2?: any, arg3?: any) {\n    // @observable someProp;\n    if (isStringish(arg2)) {\n        storeAnnotation(v, arg2, observableAnnotation)\n        return\n    }\n\n    // already observable - ignore\n    if (isObservable(v)) {\n        return v\n    }\n\n    // plain object\n    if (isPlainObject(v)) {\n        return observable.object(v, arg2, arg3)\n    }\n\n    // Array\n    if (Array.isArray(v)) {\n        return observable.array(v, arg2)\n    }\n\n    // Map\n    if (isES6Map(v)) {\n        return observable.map(v, arg2)\n    }\n\n    // Set\n    if (isES6Set(v)) {\n        return observable.set(v, arg2)\n    }\n\n    // other object - ignore\n    if (typeof v === \"object\" && v !== null) {\n        return v\n    }\n\n    // anything else\n    return observable.box(v, arg2)\n}\nObject.assign(createObservable, observableDecoratorAnnotation)\n\nexport interface IObservableValueFactory {\n    <T>(value: T, options?: CreateObservableOptions): IObservableValue<T>\n    <T>(value?: T, options?: CreateObservableOptions): IObservableValue<T | undefined>\n}\n\nexport interface IObservableFactory extends Annotation, PropertyDecorator {\n    <T = any>(value: T[], options?: CreateObservableOptions): IObservableArray<T>\n    <T = any>(value: Set<T>, options?: CreateObservableOptions): ObservableSet<T>\n    <K = any, V = any>(value: Map<K, V>, options?: CreateObservableOptions): ObservableMap<K, V>\n    <T extends object>(\n        value: T,\n        decorators?: AnnotationsMap<T, never>,\n        options?: CreateObservableOptions\n    ): T\n\n    box: IObservableValueFactory\n    array: <T = any>(initialValues?: T[], options?: CreateObservableOptions) => IObservableArray<T>\n    set: <T = any>(\n        initialValues?: IObservableSetInitialValues<T>,\n        options?: CreateObservableOptions\n    ) => ObservableSet<T>\n    map: <K = any, V = any>(\n        initialValues?: IObservableMapInitialValues<K, V>,\n        options?: CreateObservableOptions\n    ) => ObservableMap<K, V>\n    object: <T = any>(\n        props: T,\n        decorators?: AnnotationsMap<T, never>,\n        options?: CreateObservableOptions\n    ) => T\n\n    /**\n     * Decorator that creates an observable that only observes the references, but doesn't try to turn the assigned value into an observable.ts.\n     */\n    ref: Annotation & PropertyDecorator\n    /**\n     * Decorator that creates an observable converts its value (objects, maps or arrays) into a shallow observable structure\n     */\n    shallow: Annotation & PropertyDecorator\n    deep: Annotation & PropertyDecorator\n    struct: Annotation & PropertyDecorator\n}\n\nconst observableFactories: IObservableFactory = {\n    box<T = any>(value: T, options?: CreateObservableOptions): IObservableValue<T> {\n        const o = asCreateObservableOptions(options)\n        return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals)\n    },\n    array<T = any>(initialValues?: T[], options?: CreateObservableOptions): IObservableArray<T> {\n        const o = asCreateObservableOptions(options)\n        return (\n            globalState.useProxies === false || o.proxy === false\n                ? createLegacyArray\n                : createObservableArray\n        )(initialValues, getEnhancerFromOptions(o), o.name)\n    },\n    map<K = any, V = any>(\n        initialValues?: IObservableMapInitialValues<K, V>,\n        options?: CreateObservableOptions\n    ): ObservableMap<K, V> {\n        const o = asCreateObservableOptions(options)\n        return new ObservableMap<K, V>(initialValues, getEnhancerFromOptions(o), o.name)\n    },\n    set<T = any>(\n        initialValues?: IObservableSetInitialValues<T>,\n        options?: CreateObservableOptions\n    ): ObservableSet<T> {\n        const o = asCreateObservableOptions(options)\n        return new ObservableSet<T>(initialValues, getEnhancerFromOptions(o), o.name)\n    },\n    object<T extends object = any>(\n        props: T,\n        decorators?: AnnotationsMap<T, never>,\n        options?: CreateObservableOptions\n    ): T {\n        return extendObservable(\n            globalState.useProxies === false || options?.proxy === false\n                ? asObservableObject({}, options)\n                : asDynamicObservableObject({}, options),\n            props,\n            decorators\n        )\n    },\n    ref: createDecoratorAnnotation(observableRefAnnotation),\n    shallow: createDecoratorAnnotation(observableShallowAnnotation),\n    deep: observableDecoratorAnnotation,\n    struct: createDecoratorAnnotation(observableStructAnnotation)\n} as any\n\n// eslint-disable-next-line\nexport var observable: IObservableFactory = assign(createObservable, observableFactories)\n","import {\n    ComputedValue,\n    IComputedValueOptions,\n    Annotation,\n    storeAnnotation,\n    createDecoratorAnnotation,\n    isStringish,\n    isPlainObject,\n    isFunction,\n    die,\n    IComputedValue,\n    createComputedAnnotation,\n    comparer\n} from \"../internal\"\n\nexport const COMPUTED = \"computed\"\nexport const COMPUTED_STRUCT = \"computed.struct\"\n\nexport interface IComputedFactory extends Annotation, PropertyDecorator {\n    // @computed(opts)\n    <T>(options: IComputedValueOptions<T>): Annotation & PropertyDecorator\n    // computed(fn, opts)\n    <T>(func: () => T, options?: IComputedValueOptions<T>): IComputedValue<T>\n\n    struct: Annotation & PropertyDecorator\n}\n\nconst computedAnnotation = createComputedAnnotation(COMPUTED)\nconst computedStructAnnotation = createComputedAnnotation(COMPUTED_STRUCT, {\n    equals: comparer.structural\n})\n\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nexport const computed: IComputedFactory = function computed(arg1, arg2) {\n    if (isStringish(arg2)) {\n        // @computed\n        return storeAnnotation(arg1, arg2, computedAnnotation)\n    }\n    if (isPlainObject(arg1)) {\n        // @computed({ options })\n        return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1))\n    }\n\n    // computed(expr, options?)\n    if (__DEV__) {\n        if (!isFunction(arg1)) {\n            die(\"First argument to `computed` should be an expression.\")\n        }\n        if (isFunction(arg2)) {\n            die(\n                \"A setter as second argument is no longer supported, use `{ set: fn }` option instead\"\n            )\n        }\n    }\n    const opts: IComputedValueOptions<any> = isPlainObject(arg2) ? arg2 : {}\n    opts.get = arg1\n    opts.name ||= arg1.name || \"\" /* for generated name */\n\n    return new ComputedValue(opts)\n} as any\n\nObject.assign(computed, computedAnnotation)\n\ncomputed.struct = createDecoratorAnnotation(computedStructAnnotation)\n","import {\n    IDerivation,\n    endBatch,\n    globalState,\n    isSpyEnabled,\n    spyReportEnd,\n    spyReportStart,\n    startBatch,\n    untrackedEnd,\n    untrackedStart,\n    isFunction,\n    allowStateReadsStart,\n    allowStateReadsEnd,\n    ACTION,\n    EMPTY_ARRAY,\n    die,\n    getDescriptor\n} from \"../internal\"\n\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nlet currentActionId = 0\nlet nextActionId = 1\nconst isFunctionNameConfigurable = getDescriptor(() => {}, \"name\")?.configurable ?? false\n\n// we can safely recycle this object\nconst tmpNameDescriptor: PropertyDescriptor = {\n    value: \"action\",\n    configurable: true,\n    writable: false,\n    enumerable: false\n}\n\nexport function createAction(\n    actionName: string,\n    fn: Function,\n    autoAction: boolean = false,\n    ref?: Object\n): Function {\n    if (__DEV__) {\n        if (!isFunction(fn)) {\n            die(\"`action` can only be invoked on functions\")\n        }\n        if (typeof actionName !== \"string\" || !actionName) {\n            die(`actions should have valid names, got: '${actionName}'`)\n        }\n    }\n    function res() {\n        return executeAction(actionName, autoAction, fn, ref || this, arguments)\n    }\n    res.isMobxAction = true\n    if (isFunctionNameConfigurable) {\n        tmpNameDescriptor.value = actionName\n        Object.defineProperty(res, \"name\", tmpNameDescriptor)\n    }\n    return res\n}\n\nexport function executeAction(\n    actionName: string,\n    canRunAsDerivation: boolean,\n    fn: Function,\n    scope?: any,\n    args?: IArguments\n) {\n    const runInfo = _startAction(actionName, canRunAsDerivation, scope, args)\n    try {\n        return fn.apply(scope, args)\n    } catch (err) {\n        runInfo.error_ = err\n        throw err\n    } finally {\n        _endAction(runInfo)\n    }\n}\n\nexport interface IActionRunInfo {\n    prevDerivation_: IDerivation | null\n    prevAllowStateChanges_: boolean\n    prevAllowStateReads_: boolean\n    notifySpy_: boolean\n    startTime_: number\n    error_?: any\n    parentActionId_: number\n    actionId_: number\n    runAsAction_?: boolean\n}\n\nexport function _startAction(\n    actionName: string,\n    canRunAsDerivation: boolean, // true for autoAction\n    scope: any,\n    args?: IArguments\n): IActionRunInfo {\n    const notifySpy_ = __DEV__ && isSpyEnabled() && !!actionName\n    let startTime_: number = 0\n    if (__DEV__ && notifySpy_) {\n        startTime_ = Date.now()\n        const flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY\n        spyReportStart({\n            type: ACTION,\n            name: actionName,\n            object: scope,\n            arguments: flattenedArgs\n        })\n    }\n    const prevDerivation_ = globalState.trackingDerivation\n    const runAsAction = !canRunAsDerivation || !prevDerivation_\n    startBatch()\n    let prevAllowStateChanges_ = globalState.allowStateChanges // by default preserve previous allow\n    if (runAsAction) {\n        untrackedStart()\n        prevAllowStateChanges_ = allowStateChangesStart(true)\n    }\n    const prevAllowStateReads_ = allowStateReadsStart(true)\n    const runInfo = {\n        runAsAction_: runAsAction,\n        prevDerivation_,\n        prevAllowStateChanges_,\n        prevAllowStateReads_,\n        notifySpy_,\n        startTime_,\n        actionId_: nextActionId++,\n        parentActionId_: currentActionId\n    }\n    currentActionId = runInfo.actionId_\n    return runInfo\n}\n\nexport function _endAction(runInfo: IActionRunInfo) {\n    if (currentActionId !== runInfo.actionId_) {\n        die(30)\n    }\n    currentActionId = runInfo.parentActionId_\n\n    if (runInfo.error_ !== undefined) {\n        globalState.suppressReactionErrors = true\n    }\n    allowStateChangesEnd(runInfo.prevAllowStateChanges_)\n    allowStateReadsEnd(runInfo.prevAllowStateReads_)\n    endBatch()\n    if (runInfo.runAsAction_) {\n        untrackedEnd(runInfo.prevDerivation_)\n    }\n    if (__DEV__ && runInfo.notifySpy_) {\n        spyReportEnd({ time: Date.now() - runInfo.startTime_ })\n    }\n    globalState.suppressReactionErrors = false\n}\n\nexport function allowStateChanges<T>(allowStateChanges: boolean, func: () => T): T {\n    const prev = allowStateChangesStart(allowStateChanges)\n    try {\n        return func()\n    } finally {\n        allowStateChangesEnd(prev)\n    }\n}\n\nexport function allowStateChangesStart(allowStateChanges: boolean) {\n    const prev = globalState.allowStateChanges\n    globalState.allowStateChanges = allowStateChanges\n    return prev\n}\n\nexport function allowStateChangesEnd(prev: boolean) {\n    globalState.allowStateChanges = prev\n}\n","import {\n    Atom,\n    IEnhancer,\n    IInterceptable,\n    IEqualsComparer,\n    IInterceptor,\n    IListenable,\n    Lambda,\n    checkIfStateModificationsAreAllowed,\n    comparer,\n    createInstanceofPredicate,\n    getNextId,\n    hasInterceptors,\n    hasListeners,\n    interceptChange,\n    isSpyEnabled,\n    notifyListeners,\n    registerInterceptor,\n    registerListener,\n    spyReport,\n    spyReportEnd,\n    spyReportStart,\n    toPrimitive,\n    globalState,\n    IUNCHANGED,\n    UPDATE\n} from \"../internal\"\n\nexport interface IValueWillChange<T> {\n    object: IObservableValue<T>\n    type: \"update\"\n    newValue: T\n}\n\nexport type IValueDidChange<T = any> = {\n    type: \"update\"\n    observableKind: \"value\"\n    object: IObservableValue<T>\n    debugObjectName: string\n    newValue: unknown\n    oldValue: unknown\n}\nexport type IBoxDidChange<T = any> =\n    | {\n          type: \"create\"\n          observableKind: \"value\"\n          object: IObservableValue<T>\n          debugObjectName: string\n          newValue: unknown\n      }\n    | IValueDidChange<T>\n\nexport interface IObservableValue<T> {\n    get(): T\n    set(value: T): void\n    intercept_(handler: IInterceptor<IValueWillChange<T>>): Lambda\n    observe_(listener: (change: IValueDidChange<T>) => void, fireImmediately?: boolean): Lambda\n}\n\nconst CREATE = \"create\"\n\nexport class ObservableValue<T>\n    extends Atom\n    implements IObservableValue<T>, IInterceptable<IValueWillChange<T>>, IListenable\n{\n    hasUnreportedChange_ = false\n    interceptors_\n    changeListeners_\n    value_\n    dehancer: any\n\n    constructor(\n        value: T,\n        public enhancer: IEnhancer<T>,\n        public name_ = __DEV__ ? \"ObservableValue@\" + getNextId() : \"ObservableValue\",\n        notifySpy = true,\n        private equals: IEqualsComparer<any> = comparer.default\n    ) {\n        super(name_)\n        this.value_ = enhancer(value, undefined, name_)\n        if (__DEV__ && notifySpy && isSpyEnabled()) {\n            // only notify spy if this is a stand-alone observable\n            spyReport({\n                type: CREATE,\n                object: this,\n                observableKind: \"value\",\n                debugObjectName: this.name_,\n                newValue: \"\" + this.value_\n            })\n        }\n    }\n\n    private dehanceValue(value: T): T {\n        if (this.dehancer !== undefined) {\n            return this.dehancer(value)\n        }\n        return value\n    }\n\n    public set(newValue: T) {\n        const oldValue = this.value_\n        newValue = this.prepareNewValue_(newValue) as any\n        if (newValue !== globalState.UNCHANGED) {\n            const notifySpy = isSpyEnabled()\n            if (__DEV__ && notifySpy) {\n                spyReportStart({\n                    type: UPDATE,\n                    object: this,\n                    observableKind: \"value\",\n                    debugObjectName: this.name_,\n                    newValue,\n                    oldValue\n                })\n            }\n            this.setNewValue_(newValue)\n            if (__DEV__ && notifySpy) {\n                spyReportEnd()\n            }\n        }\n    }\n\n    private prepareNewValue_(newValue): T | IUNCHANGED {\n        checkIfStateModificationsAreAllowed(this)\n        if (hasInterceptors(this)) {\n            const change = interceptChange<IValueWillChange<T>>(this, {\n                object: this,\n                type: UPDATE,\n                newValue\n            })\n            if (!change) {\n                return globalState.UNCHANGED\n            }\n            newValue = change.newValue\n        }\n        // apply modifier\n        newValue = this.enhancer(newValue, this.value_, this.name_)\n        return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue\n    }\n\n    setNewValue_(newValue: T) {\n        const oldValue = this.value_\n        this.value_ = newValue\n        this.reportChanged()\n        if (hasListeners(this)) {\n            notifyListeners(this, {\n                type: UPDATE,\n                object: this,\n                newValue,\n                oldValue\n            })\n        }\n    }\n\n    public get(): T {\n        this.reportObserved()\n        return this.dehanceValue(this.value_)\n    }\n\n    intercept_(handler: IInterceptor<IValueWillChange<T>>): Lambda {\n        return registerInterceptor(this, handler)\n    }\n\n    observe_(listener: (change: IValueDidChange<T>) => void, fireImmediately?: boolean): Lambda {\n        if (fireImmediately) {\n            listener({\n                observableKind: \"value\",\n                debugObjectName: this.name_,\n                object: this,\n                type: UPDATE,\n                newValue: this.value_,\n                oldValue: undefined\n            })\n        }\n        return registerListener(this, listener)\n    }\n\n    raw() {\n        // used by MST ot get undehanced value\n        return this.value_\n    }\n\n    toJSON() {\n        return this.get()\n    }\n\n    toString() {\n        return `${this.name_}[${this.value_}]`\n    }\n\n    valueOf(): T {\n        return toPrimitive(this.get())\n    }\n\n    [Symbol.toPrimitive]() {\n        return this.valueOf()\n    }\n}\n\nexport const isObservableValue = createInstanceofPredicate(\"ObservableValue\", ObservableValue) as (\n    x: any\n) => x is IObservableValue<any>\n","import {\n    CaughtException,\n    IDerivation,\n    IDerivationState_,\n    IEqualsComparer,\n    IObservable,\n    Lambda,\n    TraceMode,\n    autorun,\n    clearObserving,\n    comparer,\n    createAction,\n    createInstanceofPredicate,\n    endBatch,\n    getNextId,\n    globalState,\n    isCaughtException,\n    isSpyEnabled,\n    propagateChangeConfirmed,\n    propagateMaybeChanged,\n    reportObserved,\n    shouldCompute,\n    spyReport,\n    startBatch,\n    toPrimitive,\n    trackDerivedFunction,\n    untrackedEnd,\n    untrackedStart,\n    UPDATE,\n    die,\n    allowStateChangesStart,\n    allowStateChangesEnd\n} from \"../internal\"\n\nexport interface IComputedValue<T> {\n    get(): T\n    set(value: T): void\n    observe_(listener: (change: IComputedDidChange<T>) => void, fireImmediately?: boolean): Lambda\n}\n\nexport interface IComputedValueOptions<T> {\n    get?: () => T\n    set?: (value: T) => void\n    name?: string\n    equals?: IEqualsComparer<T>\n    context?: any\n    requiresReaction?: boolean\n    keepAlive?: boolean\n}\n\nexport type IComputedDidChange<T = any> = {\n    type: \"update\"\n    observableKind: \"computed\"\n    object: unknown\n    debugObjectName: string\n    newValue: T\n    oldValue: T | undefined\n}\n\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n *    give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n *    if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n *    go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\nexport class ComputedValue<T> implements IObservable, IComputedValue<T>, IDerivation {\n    dependenciesState_ = IDerivationState_.NOT_TRACKING_\n    observing_: IObservable[] = [] // nodes we are looking at. Our value depends on these nodes\n    newObserving_ = null // during tracking it's an array with new observed observers\n    isBeingObserved_ = false\n    isPendingUnobservation_: boolean = false\n    observers_ = new Set<IDerivation>()\n    diffValue_ = 0\n    runId_ = 0\n    lastAccessedBy_ = 0\n    lowestObserverState_ = IDerivationState_.UP_TO_DATE_\n    unboundDepsCount_ = 0\n    protected value_: T | undefined | CaughtException = new CaughtException(null)\n    name_: string\n    triggeredBy_?: string\n    isComputing_: boolean = false // to check for cycles\n    isRunningSetter_: boolean = false\n    derivation: () => T // N.B: unminified as it is used by MST\n    setter_?: (value: T) => void\n    isTracing_: TraceMode = TraceMode.NONE\n    scope_: Object | undefined\n    private equals_: IEqualsComparer<any>\n    private requiresReaction_: boolean | undefined\n    keepAlive_: boolean\n\n    /**\n     * Create a new computed value based on a function expression.\n     *\n     * The `name` property is for debug purposes only.\n     *\n     * The `equals` property specifies the comparer function to use to determine if a newly produced\n     * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n     * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\n     * Structural comparison can be convenient if you always produce a new aggregated object and\n     * don't want to notify observers if it is structurally the same.\n     * This is useful for working with vectors, mouse coordinates etc.\n     */\n    constructor(options: IComputedValueOptions<T>) {\n        if (!options.get) {\n            die(31)\n        }\n        this.derivation = options.get!\n        this.name_ = options.name || (__DEV__ ? \"ComputedValue@\" + getNextId() : \"ComputedValue\")\n        if (options.set) {\n            this.setter_ = createAction(\n                __DEV__ ? this.name_ + \"-setter\" : \"ComputedValue-setter\",\n                options.set\n            ) as any\n        }\n        this.equals_ =\n            options.equals ||\n            ((options as any).compareStructural || (options as any).struct\n                ? comparer.structural\n                : comparer.default)\n        this.scope_ = options.context\n        this.requiresReaction_ = options.requiresReaction\n        this.keepAlive_ = !!options.keepAlive\n    }\n\n    onBecomeStale_() {\n        propagateMaybeChanged(this)\n    }\n\n    public onBOL: Set<Lambda> | undefined\n    public onBUOL: Set<Lambda> | undefined\n\n    public onBO() {\n        if (this.onBOL) {\n            this.onBOL.forEach(listener => listener())\n        }\n    }\n\n    public onBUO() {\n        if (this.onBUOL) {\n            this.onBUOL.forEach(listener => listener())\n        }\n    }\n\n    /**\n     * Returns the current value of this computed value.\n     * Will evaluate its computation first if needed.\n     */\n    public get(): T {\n        if (this.isComputing_) {\n            die(32, this.name_, this.derivation)\n        }\n        if (\n            globalState.inBatch === 0 &&\n            // !globalState.trackingDerivatpion &&\n            this.observers_.size === 0 &&\n            !this.keepAlive_\n        ) {\n            if (shouldCompute(this)) {\n                this.warnAboutUntrackedRead_()\n                startBatch() // See perf test 'computed memoization'\n                this.value_ = this.computeValue_(false)\n                endBatch()\n            }\n        } else {\n            reportObserved(this)\n            if (shouldCompute(this)) {\n                let prevTrackingContext = globalState.trackingContext\n                if (this.keepAlive_ && !prevTrackingContext) {\n                    globalState.trackingContext = this\n                }\n                if (this.trackAndCompute()) {\n                    propagateChangeConfirmed(this)\n                }\n                globalState.trackingContext = prevTrackingContext\n            }\n        }\n        const result = this.value_!\n\n        if (isCaughtException(result)) {\n            throw result.cause\n        }\n        return result\n    }\n\n    public set(value: T) {\n        if (this.setter_) {\n            if (this.isRunningSetter_) {\n                die(33, this.name_)\n            }\n            this.isRunningSetter_ = true\n            try {\n                this.setter_.call(this.scope_, value)\n            } finally {\n                this.isRunningSetter_ = false\n            }\n        } else {\n            die(34, this.name_)\n        }\n    }\n\n    trackAndCompute(): boolean {\n        // N.B: unminified as it is used by MST\n        const oldValue = this.value_\n        const wasSuspended =\n            /* see #1208 */ this.dependenciesState_ === IDerivationState_.NOT_TRACKING_\n        const newValue = this.computeValue_(true)\n\n        const changed =\n            wasSuspended ||\n            isCaughtException(oldValue) ||\n            isCaughtException(newValue) ||\n            !this.equals_(oldValue, newValue)\n\n        if (changed) {\n            this.value_ = newValue\n\n            if (__DEV__ && isSpyEnabled()) {\n                spyReport({\n                    observableKind: \"computed\",\n                    debugObjectName: this.name_,\n                    object: this.scope_,\n                    type: \"update\",\n                    oldValue,\n                    newValue\n                } as IComputedDidChange)\n            }\n        }\n\n        return changed\n    }\n\n    computeValue_(track: boolean) {\n        this.isComputing_ = true\n        // don't allow state changes during computation\n        const prev = allowStateChangesStart(false)\n        let res: T | CaughtException\n        if (track) {\n            res = trackDerivedFunction(this, this.derivation, this.scope_)\n        } else {\n            if (globalState.disableErrorBoundaries === true) {\n                res = this.derivation.call(this.scope_)\n            } else {\n                try {\n                    res = this.derivation.call(this.scope_)\n                } catch (e) {\n                    res = new CaughtException(e)\n                }\n            }\n        }\n        allowStateChangesEnd(prev)\n        this.isComputing_ = false\n        return res\n    }\n\n    suspend_() {\n        if (!this.keepAlive_) {\n            clearObserving(this)\n            this.value_ = undefined // don't hold on to computed value!\n            if (__DEV__ && this.isTracing_ !== TraceMode.NONE) {\n                console.log(\n                    `[mobx.trace] Computed value '${this.name_}' was suspended and it will recompute on the next access.`\n                )\n            }\n        }\n    }\n\n    observe_(listener: (change: IComputedDidChange<T>) => void, fireImmediately?: boolean): Lambda {\n        let firstTime = true\n        let prevValue: T | undefined = undefined\n        return autorun(() => {\n            // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n            let newValue = this.get()\n            if (!firstTime || fireImmediately) {\n                const prevU = untrackedStart()\n                listener({\n                    observableKind: \"computed\",\n                    debugObjectName: this.name_,\n                    type: UPDATE,\n                    object: this,\n                    newValue,\n                    oldValue: prevValue\n                })\n                untrackedEnd(prevU)\n            }\n            firstTime = false\n            prevValue = newValue\n        })\n    }\n\n    warnAboutUntrackedRead_() {\n        if (!__DEV__) {\n            return\n        }\n        if (this.isTracing_ !== TraceMode.NONE) {\n            console.log(\n                `[mobx.trace] Computed value '${this.name_}' is being read outside a reactive context. Doing a full recompute.`\n            )\n        }\n        if (\n            typeof this.requiresReaction_ === \"boolean\"\n                ? this.requiresReaction_\n                : globalState.computedRequiresReaction\n        ) {\n            console.warn(\n                `[mobx] Computed value '${this.name_}' is being read outside a reactive context. Doing a full recompute.`\n            )\n        }\n    }\n\n    toString() {\n        return `${this.name_}[${this.derivation.toString()}]`\n    }\n\n    valueOf(): T {\n        return toPrimitive(this.get())\n    }\n\n    [Symbol.toPrimitive]() {\n        return this.valueOf()\n    }\n}\n\nexport const isComputedValue = createInstanceofPredicate(\"ComputedValue\", ComputedValue)\n","import {\n    IAtom,\n    IDepTreeNode,\n    IObservable,\n    addObserver,\n    globalState,\n    isComputedValue,\n    removeObserver\n} from \"../internal\"\n\nexport enum IDerivationState_ {\n    // before being run or (outside batch and not being observed)\n    // at this point derivation is not holding any data about dependency tree\n    NOT_TRACKING_ = -1,\n    // no shallow dependency changed since last computation\n    // won't recalculate derivation\n    // this is what makes mobx fast\n    UP_TO_DATE_ = 0,\n    // some deep dependency changed, but don't know if shallow dependency changed\n    // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n    // currently only ComputedValue will propagate POSSIBLY_STALE\n    //\n    // having this state is second big optimization:\n    // don't have to recompute on every dependency change, but only when it's needed\n    POSSIBLY_STALE_ = 1,\n    // A shallow dependency has changed since last computation and the derivation\n    // will need to recompute when it's needed next.\n    STALE_ = 2\n}\n\nexport enum TraceMode {\n    NONE,\n    LOG,\n    BREAK\n}\n\n/**\n * A derivation is everything that can be derived from the state (all the atoms) in a pure manner.\n * See https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n */\nexport interface IDerivation extends IDepTreeNode {\n    observing_: IObservable[]\n    newObserving_: null | IObservable[]\n    dependenciesState_: IDerivationState_\n    /**\n     * Id of the current run of a derivation. Each time the derivation is tracked\n     * this number is increased by one. This number is globally unique\n     */\n    runId_: number\n    /**\n     * amount of dependencies used by the derivation in this run, which has not been bound yet.\n     */\n    unboundDepsCount_: number\n    onBecomeStale_(): void\n    isTracing_: TraceMode\n\n    /**\n     *  warn if the derivation has no dependencies after creation/update\n     */\n    requiresObservable_?: boolean\n}\n\nexport class CaughtException {\n    constructor(public cause: any) {\n        // Empty\n    }\n}\n\nexport function isCaughtException(e: any): e is CaughtException {\n    return e instanceof CaughtException\n}\n\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nexport function shouldCompute(derivation: IDerivation): boolean {\n    switch (derivation.dependenciesState_) {\n        case IDerivationState_.UP_TO_DATE_:\n            return false\n        case IDerivationState_.NOT_TRACKING_:\n        case IDerivationState_.STALE_:\n            return true\n        case IDerivationState_.POSSIBLY_STALE_: {\n            // state propagation can occur outside of action/reactive context #2195\n            const prevAllowStateReads = allowStateReadsStart(true)\n            const prevUntracked = untrackedStart() // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n            const obs = derivation.observing_,\n                l = obs.length\n            for (let i = 0; i < l; i++) {\n                const obj = obs[i]\n                if (isComputedValue(obj)) {\n                    if (globalState.disableErrorBoundaries) {\n                        obj.get()\n                    } else {\n                        try {\n                            obj.get()\n                        } catch (e) {\n                            // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n                            untrackedEnd(prevUntracked)\n                            allowStateReadsEnd(prevAllowStateReads)\n                            return true\n                        }\n                    }\n                    // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n                    // and `derivation` is an observer of `obj`\n                    // invariantShouldCompute(derivation)\n                    if ((derivation.dependenciesState_ as any) === IDerivationState_.STALE_) {\n                        untrackedEnd(prevUntracked)\n                        allowStateReadsEnd(prevAllowStateReads)\n                        return true\n                    }\n                }\n            }\n            changeDependenciesStateTo0(derivation)\n            untrackedEnd(prevUntracked)\n            allowStateReadsEnd(prevAllowStateReads)\n            return false\n        }\n    }\n}\n\nexport function isComputingDerivation() {\n    return globalState.trackingDerivation !== null // filter out actions inside computations\n}\n\nexport function checkIfStateModificationsAreAllowed(atom: IAtom) {\n    if (!__DEV__) {\n        return\n    }\n    const hasObservers = atom.observers_.size > 0\n    // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n    if (\n        !globalState.allowStateChanges &&\n        (hasObservers || globalState.enforceActions === \"always\")\n    ) {\n        console.warn(\n            \"[MobX] \" +\n                (globalState.enforceActions\n                    ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \"\n                    : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") +\n                atom.name_\n        )\n    }\n}\n\nexport function checkIfStateReadsAreAllowed(observable: IObservable) {\n    if (__DEV__ && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n        console.warn(\n            `[mobx] Observable '${observable.name_}' being read outside a reactive context.`\n        )\n    }\n}\n\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nexport function trackDerivedFunction<T>(derivation: IDerivation, f: () => T, context: any) {\n    const prevAllowStateReads = allowStateReadsStart(true)\n    // pre allocate array allocation + room for variation in deps\n    // array will be trimmed by bindDependencies\n    changeDependenciesStateTo0(derivation)\n    derivation.newObserving_ = new Array(derivation.observing_.length + 100)\n    derivation.unboundDepsCount_ = 0\n    derivation.runId_ = ++globalState.runId\n    const prevTracking = globalState.trackingDerivation\n    globalState.trackingDerivation = derivation\n    globalState.inBatch++\n    let result\n    if (globalState.disableErrorBoundaries === true) {\n        result = f.call(context)\n    } else {\n        try {\n            result = f.call(context)\n        } catch (e) {\n            result = new CaughtException(e)\n        }\n    }\n    globalState.inBatch--\n    globalState.trackingDerivation = prevTracking\n    bindDependencies(derivation)\n\n    warnAboutDerivationWithoutDependencies(derivation)\n    allowStateReadsEnd(prevAllowStateReads)\n    return result\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation: IDerivation) {\n    if (!__DEV__) {\n        return\n    }\n\n    if (derivation.observing_.length !== 0) {\n        return\n    }\n\n    if (\n        typeof derivation.requiresObservable_ === \"boolean\"\n            ? derivation.requiresObservable_\n            : globalState.reactionRequiresObservable\n    ) {\n        console.warn(\n            `[mobx] Derivation '${derivation.name_}' is created/updated without reading any observable value.`\n        )\n    }\n}\n\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation: IDerivation) {\n    // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n    const prevObserving = derivation.observing_\n    const observing = (derivation.observing_ = derivation.newObserving_!)\n    let lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_\n\n    // Go through all new observables and check diffValue: (this list can contain duplicates):\n    //   0: first occurrence, change to 1 and keep it\n    //   1: extra occurrence, drop it\n    let i0 = 0,\n        l = derivation.unboundDepsCount_\n    for (let i = 0; i < l; i++) {\n        const dep = observing[i]\n        if (dep.diffValue_ === 0) {\n            dep.diffValue_ = 1\n            if (i0 !== i) {\n                observing[i0] = dep\n            }\n            i0++\n        }\n\n        // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n        // not hitting the condition\n        if ((dep as any as IDerivation).dependenciesState_ > lowestNewObservingDerivationState) {\n            lowestNewObservingDerivationState = (dep as any as IDerivation).dependenciesState_\n        }\n    }\n    observing.length = i0\n\n    derivation.newObserving_ = null // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n\n    // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n    //   0: it's not in new observables, unobserve it\n    //   1: it keeps being observed, don't want to notify it. change to 0\n    l = prevObserving.length\n    while (l--) {\n        const dep = prevObserving[l]\n        if (dep.diffValue_ === 0) {\n            removeObserver(dep, derivation)\n        }\n        dep.diffValue_ = 0\n    }\n\n    // Go through all new observables and check diffValue: (now it should be unique)\n    //   0: it was set to 0 in last loop. don't need to do anything.\n    //   1: it wasn't observed, let's observe it. set back to 0\n    while (i0--) {\n        const dep = observing[i0]\n        if (dep.diffValue_ === 1) {\n            dep.diffValue_ = 0\n            addObserver(dep, derivation)\n        }\n    }\n\n    // Some new observed derivations may become stale during this derivation computation\n    // so they have had no chance to propagate staleness (#916)\n    if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n        derivation.dependenciesState_ = lowestNewObservingDerivationState\n        derivation.onBecomeStale_()\n    }\n}\n\nexport function clearObserving(derivation: IDerivation) {\n    // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n    const obs = derivation.observing_\n    derivation.observing_ = []\n    let i = obs.length\n    while (i--) {\n        removeObserver(obs[i], derivation)\n    }\n\n    derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_\n}\n\nexport function untracked<T>(action: () => T): T {\n    const prev = untrackedStart()\n    try {\n        return action()\n    } finally {\n        untrackedEnd(prev)\n    }\n}\n\nexport function untrackedStart(): IDerivation | null {\n    const prev = globalState.trackingDerivation\n    globalState.trackingDerivation = null\n    return prev\n}\n\nexport function untrackedEnd(prev: IDerivation | null) {\n    globalState.trackingDerivation = prev\n}\n\nexport function allowStateReadsStart(allowStateReads: boolean) {\n    const prev = globalState.allowStateReads\n    globalState.allowStateReads = allowStateReads\n    return prev\n}\n\nexport function allowStateReadsEnd(prev: boolean) {\n    globalState.allowStateReads = prev\n}\n\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nexport function changeDependenciesStateTo0(derivation: IDerivation) {\n    if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n        return\n    }\n    derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_\n\n    const obs = derivation.observing_\n    let i = obs.length\n    while (i--) {\n        obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_\n    }\n}\n","import { IDerivation, IObservable, Reaction, die, getGlobal } from \"../internal\"\nimport { ComputedValue } from \"./computedvalue\"\n\n/**\n * These values will persist if global state is reset\n */\nconst persistentKeys: (keyof MobXGlobals)[] = [\n    \"mobxGuid\",\n    \"spyListeners\",\n    \"enforceActions\",\n    \"computedRequiresReaction\",\n    \"reactionRequiresObservable\",\n    \"observableRequiresReaction\",\n    \"allowStateReads\",\n    \"disableErrorBoundaries\",\n    \"runId\",\n    \"UNCHANGED\",\n    \"useProxies\"\n]\n\nexport type IUNCHANGED = {}\n\nexport class MobXGlobals {\n    /**\n     * MobXGlobals version.\n     * MobX compatiblity with other versions loaded in memory as long as this version matches.\n     * It indicates that the global state still stores similar information\n     *\n     * N.B: this version is unrelated to the package version of MobX, and is only the version of the\n     * internal state storage of MobX, and can be the same across many different package versions\n     */\n    version = 6\n\n    /**\n     * globally unique token to signal unchanged\n     */\n    UNCHANGED: IUNCHANGED = {}\n\n    /**\n     * Currently running derivation\n     */\n    trackingDerivation: IDerivation | null = null\n\n    /**\n     * Currently running reaction. This determines if we currently have a reactive context.\n     * (Tracking derivation is also set for temporal tracking of computed values inside actions,\n     * but trackingReaction can only be set by a form of Reaction)\n     */\n    trackingContext: Reaction | ComputedValue<any> | null = null\n\n    /**\n     * Each time a derivation is tracked, it is assigned a unique run-id\n     */\n    runId = 0\n\n    /**\n     * 'guid' for general purpose. Will be persisted amongst resets.\n     */\n    mobxGuid = 0\n\n    /**\n     * Are we in a batch block? (and how many of them)\n     */\n    inBatch: number = 0\n\n    /**\n     * Observables that don't have observers anymore, and are about to be\n     * suspended, unless somebody else accesses it in the same batch\n     *\n     * @type {IObservable[]}\n     */\n    pendingUnobservations: IObservable[] = []\n\n    /**\n     * List of scheduled, not yet executed, reactions.\n     */\n    pendingReactions: Reaction[] = []\n\n    /**\n     * Are we currently processing reactions?\n     */\n    isRunningReactions = false\n\n    /**\n     * Is it allowed to change observables at this point?\n     * In general, MobX doesn't allow that when running computations and React.render.\n     * To ensure that those functions stay pure.\n     */\n    allowStateChanges = false\n\n    /**\n     * Is it allowed to read observables at this point?\n     * Used to hold the state needed for `observableRequiresReaction`\n     */\n    allowStateReads = true\n\n    /**\n     * If strict mode is enabled, state changes are by default not allowed\n     */\n    enforceActions: boolean | \"always\" = true\n\n    /**\n     * Spy callbacks\n     */\n    spyListeners: { (change: any): void }[] = []\n\n    /**\n     * Globally attached error handlers that react specifically to errors in reactions\n     */\n    globalReactionErrorHandlers: ((error: any, derivation: IDerivation) => void)[] = []\n\n    /**\n     * Warn if computed values are accessed outside a reactive context\n     */\n    computedRequiresReaction = false\n\n    /**\n     * (Experimental)\n     * Warn if you try to create to derivation / reactive context without accessing any observable.\n     */\n    reactionRequiresObservable = false\n\n    /**\n     * (Experimental)\n     * Warn if observables are accessed outside a reactive context\n     */\n    observableRequiresReaction = false\n\n    /*\n     * Don't catch and rethrow exceptions. This is useful for inspecting the state of\n     * the stack when an exception occurs while debugging.\n     */\n    disableErrorBoundaries = false\n\n    /*\n     * If true, we are already handling an exception in an action. Any errors in reactions should be suppressed, as\n     * they are not the cause, see: https://github.com/mobxjs/mobx/issues/1836\n     */\n    suppressReactionErrors = false\n\n    useProxies = true\n    /*\n     * print warnings about code that would fail if proxies weren't available\n     */\n    verifyProxies = false\n\n    /**\n     * False forces all object's descriptors to\n     * writable: true\n     * configurable: true\n     */\n    safeDescriptors = true\n}\n\nlet canMergeGlobalState = true\nlet isolateCalled = false\n\nexport let globalState: MobXGlobals = (function () {\n    let global = getGlobal()\n    if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n        canMergeGlobalState = false\n    }\n    if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n        canMergeGlobalState = false\n    }\n\n    if (!canMergeGlobalState) {\n        // Because this is a IIFE we need to let isolateCalled a chance to change\n        // so we run it after the event loop completed at least 1 iteration\n        setTimeout(() => {\n            if (!isolateCalled) {\n                die(35)\n            }\n        }, 1)\n        return new MobXGlobals()\n    } else if (global.__mobxGlobals) {\n        global.__mobxInstanceCount += 1\n        if (!global.__mobxGlobals.UNCHANGED) {\n            global.__mobxGlobals.UNCHANGED = {}\n        } // make merge backward compatible\n        return global.__mobxGlobals\n    } else {\n        global.__mobxInstanceCount = 1\n        return (global.__mobxGlobals = new MobXGlobals())\n    }\n})()\n\nexport function isolateGlobalState() {\n    if (\n        globalState.pendingReactions.length ||\n        globalState.inBatch ||\n        globalState.isRunningReactions\n    ) {\n        die(36)\n    }\n    isolateCalled = true\n    if (canMergeGlobalState) {\n        let global = getGlobal()\n        if (--global.__mobxInstanceCount === 0) {\n            global.__mobxGlobals = undefined\n        }\n        globalState = new MobXGlobals()\n    }\n}\n\nexport function getGlobalState(): any {\n    return globalState\n}\n\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nexport function resetGlobalState() {\n    const defaultGlobals = new MobXGlobals()\n    for (let key in defaultGlobals) {\n        if (persistentKeys.indexOf(key as any) === -1) {\n            globalState[key] = defaultGlobals[key]\n        }\n    }\n    globalState.allowStateChanges = !globalState.enforceActions\n}\n","import {\n    Lambda,\n    ComputedValue,\n    IDependencyTree,\n    IDerivation,\n    IDerivationState_,\n    TraceMode,\n    getDependencyTree,\n    globalState,\n    runReactions,\n    checkIfStateReadsAreAllowed\n} from \"../internal\"\n\nexport interface IDepTreeNode {\n    name_: string\n    observing_?: IObservable[]\n}\n\nexport interface IObservable extends IDepTreeNode {\n    diffValue_: number\n    /**\n     * Id of the derivation *run* that last accessed this observable.\n     * If this id equals the *run* id of the current derivation,\n     * the dependency is already established\n     */\n    lastAccessedBy_: number\n    isBeingObserved_: boolean\n\n    lowestObserverState_: IDerivationState_ // Used to avoid redundant propagations\n    isPendingUnobservation_: boolean // Used to push itself to global.pendingUnobservations at most once per batch.\n\n    observers_: Set<IDerivation>\n\n    onBUO(): void\n    onBO(): void\n\n    onBUOL: Set<Lambda> | undefined\n    onBOL: Set<Lambda> | undefined\n}\n\nexport function hasObservers(observable: IObservable): boolean {\n    return observable.observers_ && observable.observers_.size > 0\n}\n\nexport function getObservers(observable: IObservable): Set<IDerivation> {\n    return observable.observers_\n}\n\n// function invariantObservers(observable: IObservable) {\n//     const list = observable.observers\n//     const map = observable.observersIndexes\n//     const l = list.length\n//     for (let i = 0; i < l; i++) {\n//         const id = list[i].__mapid\n//         if (i) {\n//             invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n//         } else {\n//             invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n//         }\n//     }\n//     invariant(\n//         list.length === 0 || Object.keys(map).length === list.length - 1,\n//         \"INTERNAL ERROR there is no junk in map\"\n//     )\n// }\nexport function addObserver(observable: IObservable, node: IDerivation) {\n    // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n    // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n    // invariantObservers(observable);\n\n    observable.observers_.add(node)\n    if (observable.lowestObserverState_ > node.dependenciesState_) {\n        observable.lowestObserverState_ = node.dependenciesState_\n    }\n\n    // invariantObservers(observable);\n    // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nexport function removeObserver(observable: IObservable, node: IDerivation) {\n    // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n    // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n    // invariantObservers(observable);\n    observable.observers_.delete(node)\n    if (observable.observers_.size === 0) {\n        // deleting last observer\n        queueForUnobservation(observable)\n    }\n    // invariantObservers(observable);\n    // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nexport function queueForUnobservation(observable: IObservable) {\n    if (observable.isPendingUnobservation_ === false) {\n        // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n        observable.isPendingUnobservation_ = true\n        globalState.pendingUnobservations.push(observable)\n    }\n}\n\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nexport function startBatch() {\n    globalState.inBatch++\n}\n\nexport function endBatch() {\n    if (--globalState.inBatch === 0) {\n        runReactions()\n        // the batch is actually about to finish, all unobserving should happen here.\n        const list = globalState.pendingUnobservations\n        for (let i = 0; i < list.length; i++) {\n            const observable = list[i]\n            observable.isPendingUnobservation_ = false\n            if (observable.observers_.size === 0) {\n                if (observable.isBeingObserved_) {\n                    // if this observable had reactive observers, trigger the hooks\n                    observable.isBeingObserved_ = false\n                    observable.onBUO()\n                }\n                if (observable instanceof ComputedValue) {\n                    // computed values are automatically teared down when the last observer leaves\n                    // this process happens recursively, this computed might be the last observabe of another, etc..\n                    observable.suspend_()\n                }\n            }\n        }\n        globalState.pendingUnobservations = []\n    }\n}\n\nexport function reportObserved(observable: IObservable): boolean {\n    checkIfStateReadsAreAllowed(observable)\n\n    const derivation = globalState.trackingDerivation\n    if (derivation !== null) {\n        /**\n         * Simple optimization, give each derivation run an unique id (runId)\n         * Check if last time this observable was accessed the same runId is used\n         * if this is the case, the relation is already known\n         */\n        if (derivation.runId_ !== observable.lastAccessedBy_) {\n            observable.lastAccessedBy_ = derivation.runId_\n            // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n            derivation.newObserving_![derivation.unboundDepsCount_++] = observable\n            if (!observable.isBeingObserved_ && globalState.trackingContext) {\n                observable.isBeingObserved_ = true\n                observable.onBO()\n            }\n        }\n        return true\n    } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n        queueForUnobservation(observable)\n    }\n\n    return false\n}\n\n// function invariantLOS(observable: IObservable, msg: string) {\n//     // it's expensive so better not run it in produciton. but temporarily helpful for testing\n//     const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n//     if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n//     throw new Error(\n//         \"lowestObserverState is wrong for \" +\n//             msg +\n//             \" because \" +\n//             min +\n//             \" < \" +\n//             observable.lowestObserverState\n//     )\n// }\n\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n\n// Called by Atom when its value changes\nexport function propagateChanged(observable: IObservable) {\n    // invariantLOS(observable, \"changed start\");\n    if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n        return\n    }\n    observable.lowestObserverState_ = IDerivationState_.STALE_\n\n    // Ideally we use for..of here, but the downcompiled version is really slow...\n    observable.observers_.forEach(d => {\n        if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n            if (__DEV__ && d.isTracing_ !== TraceMode.NONE) {\n                logTraceInfo(d, observable)\n            }\n            d.onBecomeStale_()\n        }\n        d.dependenciesState_ = IDerivationState_.STALE_\n    })\n    // invariantLOS(observable, \"changed end\");\n}\n\n// Called by ComputedValue when it recalculate and its value changed\nexport function propagateChangeConfirmed(observable: IObservable) {\n    // invariantLOS(observable, \"confirmed start\");\n    if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n        return\n    }\n    observable.lowestObserverState_ = IDerivationState_.STALE_\n\n    observable.observers_.forEach(d => {\n        if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n            d.dependenciesState_ = IDerivationState_.STALE_\n            if (__DEV__ && d.isTracing_ !== TraceMode.NONE) {\n                logTraceInfo(d, observable)\n            }\n        } else if (\n            d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n        ) {\n            observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_\n        }\n    })\n    // invariantLOS(observable, \"confirmed end\");\n}\n\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nexport function propagateMaybeChanged(observable: IObservable) {\n    // invariantLOS(observable, \"maybe start\");\n    if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n        return\n    }\n    observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_\n\n    observable.observers_.forEach(d => {\n        if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n            d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_\n            d.onBecomeStale_()\n        }\n    })\n    // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation: IDerivation, observable: IObservable) {\n    console.log(\n        `[mobx.trace] '${derivation.name_}' is invalidated due to a change in: '${observable.name_}'`\n    )\n    if (derivation.isTracing_ === TraceMode.BREAK) {\n        const lines = []\n        printDepTree(getDependencyTree(derivation), lines, 1)\n\n        // prettier-ignore\n        new Function(\n`debugger;\n/*\nTracing '${derivation.name_}'\n\nYou are entering this break point because derivation '${derivation.name_}' is being traced and '${observable.name_}' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n${derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\"}\n\nThe dependencies for this derivation are:\n\n${lines.join(\"\\n\")}\n*/\n    `)()\n    }\n}\n\nfunction printDepTree(tree: IDependencyTree, lines: string[], depth: number) {\n    if (lines.length >= 1000) {\n        lines.push(\"(and many more)\")\n        return\n    }\n    lines.push(`${\"\\t\".repeat(depth - 1)}${tree.name}`)\n    if (tree.dependencies) {\n        tree.dependencies.forEach(child => printDepTree(child, lines, depth + 1))\n    }\n}\n","import {\n    $mobx,\n    IDerivation,\n    IDerivationState_,\n    IObservable,\n    Lambda,\n    TraceMode,\n    clearObserving,\n    createInstanceofPredicate,\n    endBatch,\n    getNextId,\n    globalState,\n    isCaughtException,\n    isSpyEnabled,\n    shouldCompute,\n    spyReport,\n    spyReportEnd,\n    spyReportStart,\n    startBatch,\n    trace,\n    trackDerivedFunction\n} from \"../internal\"\n\n/**\n * Reactions are a special kind of derivations. Several things distinguishes them from normal reactive computations\n *\n * 1) They will always run, whether they are used by other computations or not.\n * This means that they are very suitable for triggering side effects like logging, updating the DOM and making network requests.\n * 2) They are not observable themselves\n * 3) They will always run after any 'normal' derivations\n * 4) They are allowed to change the state and thereby triggering themselves again, as long as they make sure the state propagates to a stable state in a reasonable amount of iterations.\n *\n * The state machine of a Reaction is as follows:\n *\n * 1) after creating, the reaction should be started by calling `runReaction` or by scheduling it (see also `autorun`)\n * 2) the `onInvalidate` handler should somehow result in a call to `this.track(someFunction)`\n * 3) all observables accessed in `someFunction` will be observed by this reaction.\n * 4) as soon as some of the dependencies has changed the Reaction will be rescheduled for another run (after the current mutation or transaction). `isScheduled` will yield true once a dependency is stale and during this period\n * 5) `onInvalidate` will be called, and we are back at step 1.\n *\n */\n\nexport interface IReactionPublic {\n    dispose(): void\n    trace(enterBreakPoint?: boolean): void\n}\n\nexport interface IReactionDisposer {\n    (): void\n    $mobx: Reaction\n}\n\nexport class Reaction implements IDerivation, IReactionPublic {\n    observing_: IObservable[] = [] // nodes we are looking at. Our value depends on these nodes\n    newObserving_: IObservable[] = []\n    dependenciesState_ = IDerivationState_.NOT_TRACKING_\n    diffValue_ = 0\n    runId_ = 0\n    unboundDepsCount_ = 0\n    isDisposed_ = false\n    isScheduled_ = false\n    isTrackPending_ = false\n    isRunning_ = false\n    isTracing_: TraceMode = TraceMode.NONE\n\n    constructor(\n        public name_: string = __DEV__ ? \"Reaction@\" + getNextId() : \"Reaction\",\n        private onInvalidate_: () => void,\n        private errorHandler_?: (error: any, derivation: IDerivation) => void,\n        public requiresObservable_?\n    ) {}\n\n    onBecomeStale_() {\n        this.schedule_()\n    }\n\n    schedule_() {\n        if (!this.isScheduled_) {\n            this.isScheduled_ = true\n            globalState.pendingReactions.push(this)\n            runReactions()\n        }\n    }\n\n    isScheduled() {\n        return this.isScheduled_\n    }\n\n    /**\n     * internal, use schedule() if you intend to kick off a reaction\n     */\n    runReaction_() {\n        if (!this.isDisposed_) {\n            startBatch()\n            this.isScheduled_ = false\n            const prev = globalState.trackingContext\n            globalState.trackingContext = this\n            if (shouldCompute(this)) {\n                this.isTrackPending_ = true\n\n                try {\n                    this.onInvalidate_()\n                    if (__DEV__ && this.isTrackPending_ && isSpyEnabled()) {\n                        // onInvalidate didn't trigger track right away..\n                        spyReport({\n                            name: this.name_,\n                            type: \"scheduled-reaction\"\n                        })\n                    }\n                } catch (e) {\n                    this.reportExceptionInDerivation_(e)\n                }\n            }\n            globalState.trackingContext = prev\n            endBatch()\n        }\n    }\n\n    track(fn: () => void) {\n        if (this.isDisposed_) {\n            return\n            // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n        }\n        startBatch()\n        const notify = isSpyEnabled()\n        let startTime\n        if (__DEV__ && notify) {\n            startTime = Date.now()\n            spyReportStart({\n                name: this.name_,\n                type: \"reaction\"\n            })\n        }\n        this.isRunning_ = true\n        const prevReaction = globalState.trackingContext // reactions could create reactions...\n        globalState.trackingContext = this\n        const result = trackDerivedFunction(this, fn, undefined)\n        globalState.trackingContext = prevReaction\n        this.isRunning_ = false\n        this.isTrackPending_ = false\n        if (this.isDisposed_) {\n            // disposed during last run. Clean up everything that was bound after the dispose call.\n            clearObserving(this)\n        }\n        if (isCaughtException(result)) {\n            this.reportExceptionInDerivation_(result.cause)\n        }\n        if (__DEV__ && notify) {\n            spyReportEnd({\n                time: Date.now() - startTime\n            })\n        }\n        endBatch()\n    }\n\n    reportExceptionInDerivation_(error: any) {\n        if (this.errorHandler_) {\n            this.errorHandler_(error, this)\n            return\n        }\n\n        if (globalState.disableErrorBoundaries) {\n            throw error\n        }\n\n        const message = __DEV__\n            ? `[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '${this}'`\n            : `[mobx] uncaught error in '${this}'`\n        if (!globalState.suppressReactionErrors) {\n            console.error(message, error)\n            /** If debugging brought you here, please, read the above message :-). Tnx! */\n        } else if (__DEV__) { console.warn(`[mobx] (error in reaction '${this.name_}' suppressed, fix error of causing action below)`) } // prettier-ignore\n\n        if (__DEV__ && isSpyEnabled()) {\n            spyReport({\n                type: \"error\",\n                name: this.name_,\n                message,\n                error: \"\" + error\n            })\n        }\n\n        globalState.globalReactionErrorHandlers.forEach(f => f(error, this))\n    }\n\n    dispose() {\n        if (!this.isDisposed_) {\n            this.isDisposed_ = true\n            if (!this.isRunning_) {\n                // if disposed while running, clean up later. Maybe not optimal, but rare case\n                startBatch()\n                clearObserving(this)\n                endBatch()\n            }\n        }\n    }\n\n    getDisposer_(): IReactionDisposer {\n        const r = this.dispose.bind(this) as IReactionDisposer\n        r[$mobx] = this\n        return r\n    }\n\n    toString() {\n        return `Reaction[${this.name_}]`\n    }\n\n    trace(enterBreakPoint: boolean = false) {\n        trace(this, enterBreakPoint)\n    }\n}\n\nexport function onReactionError(handler: (error: any, derivation: IDerivation) => void): Lambda {\n    globalState.globalReactionErrorHandlers.push(handler)\n    return () => {\n        const idx = globalState.globalReactionErrorHandlers.indexOf(handler)\n        if (idx >= 0) {\n            globalState.globalReactionErrorHandlers.splice(idx, 1)\n        }\n    }\n}\n\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nconst MAX_REACTION_ITERATIONS = 100\n\nlet reactionScheduler: (fn: () => void) => void = f => f()\n\nexport function runReactions() {\n    // Trampolining, if runReactions are already running, new reactions will be picked up\n    if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n        return\n    }\n    reactionScheduler(runReactionsHelper)\n}\n\nfunction runReactionsHelper() {\n    globalState.isRunningReactions = true\n    const allReactions = globalState.pendingReactions\n    let iterations = 0\n\n    // While running reactions, new reactions might be triggered.\n    // Hence we work with two variables and check whether\n    // we converge to no remaining reactions after a while.\n    while (allReactions.length > 0) {\n        if (++iterations === MAX_REACTION_ITERATIONS) {\n            console.error(\n                __DEV__\n                    ? `Reaction doesn't converge to a stable state after ${MAX_REACTION_ITERATIONS} iterations.` +\n                          ` Probably there is a cycle in the reactive function: ${allReactions[0]}`\n                    : `[mobx] cycle in reaction: ${allReactions[0]}`\n            )\n            allReactions.splice(0) // clear reactions\n        }\n        let remainingReactions = allReactions.splice(0)\n        for (let i = 0, l = remainingReactions.length; i < l; i++) {\n            remainingReactions[i].runReaction_()\n        }\n    }\n    globalState.isRunningReactions = false\n}\n\nexport const isReaction = createInstanceofPredicate(\"Reaction\", Reaction)\n\nexport function setReactionScheduler(fn: (f: () => void) => void) {\n    const baseScheduler = reactionScheduler\n    reactionScheduler = f => fn(() => baseScheduler(f))\n}\n","import { IComputedDidChange } from \"./computedvalue\"\nimport { IValueDidChange, IBoxDidChange } from \"./../types/observablevalue\"\nimport { IObjectDidChange } from \"./../types/observableobject\"\nimport { IArrayDidChange } from \"./../types/observablearray\"\nimport { Lambda, globalState, once, ISetDidChange, IMapDidChange } from \"../internal\"\n\nexport function isSpyEnabled() {\n    return __DEV__ && !!globalState.spyListeners.length\n}\n\nexport type PureSpyEvent =\n    | { type: \"action\"; name: string; object: unknown; arguments: unknown[] }\n    | { type: \"scheduled-reaction\"; name: string }\n    | { type: \"reaction\"; name: string }\n    | { type: \"error\"; name: string; message: string; error: string }\n    | IComputedDidChange<unknown>\n    | IObjectDidChange<unknown>\n    | IArrayDidChange<unknown>\n    | IMapDidChange<unknown, unknown>\n    | ISetDidChange<unknown>\n    | IValueDidChange<unknown>\n    | IBoxDidChange<unknown>\n    | { type: \"report-end\"; spyReportEnd: true; time?: number }\n\ntype SpyEvent = PureSpyEvent & { spyReportStart?: true }\n\nexport function spyReport(event: SpyEvent) {\n    if (!__DEV__) {\n        return\n    } // dead code elimination can do the rest\n    if (!globalState.spyListeners.length) {\n        return\n    }\n    const listeners = globalState.spyListeners\n    for (let i = 0, l = listeners.length; i < l; i++) {\n        listeners[i](event)\n    }\n}\n\nexport function spyReportStart(event: PureSpyEvent) {\n    if (!__DEV__) {\n        return\n    }\n    const change = { ...event, spyReportStart: true as const }\n    spyReport(change)\n}\n\nconst END_EVENT: SpyEvent = { type: \"report-end\", spyReportEnd: true }\n\nexport function spyReportEnd(change?: { time?: number }) {\n    if (!__DEV__) {\n        return\n    }\n    if (change) {\n        spyReport({ ...change, type: \"report-end\", spyReportEnd: true })\n    } else {\n        spyReport(END_EVENT)\n    }\n}\n\nexport function spy(listener: (change: SpyEvent) => void): Lambda {\n    if (!__DEV__) {\n        console.warn(`[mobx.spy] Is a no-op in production builds`)\n        return function () {}\n    } else {\n        globalState.spyListeners.push(listener)\n        return once(() => {\n            globalState.spyListeners = globalState.spyListeners.filter(l => l !== listener)\n        })\n    }\n}\n","import {\n    createAction,\n    executeAction,\n    Annotation,\n    storeAnnotation,\n    die,\n    isFunction,\n    isStringish,\n    createDecoratorAnnotation,\n    createActionAnnotation\n} from \"../internal\"\n\nexport const ACTION = \"action\"\nexport const ACTION_BOUND = \"action.bound\"\nexport const AUTOACTION = \"autoAction\"\nexport const AUTOACTION_BOUND = \"autoAction.bound\"\n\nconst DEFAULT_ACTION_NAME = \"<unnamed action>\"\n\nconst actionAnnotation = createActionAnnotation(ACTION)\nconst actionBoundAnnotation = createActionAnnotation(ACTION_BOUND, {\n    bound: true\n})\nconst autoActionAnnotation = createActionAnnotation(AUTOACTION, {\n    autoAction: true\n})\nconst autoActionBoundAnnotation = createActionAnnotation(AUTOACTION_BOUND, {\n    autoAction: true,\n    bound: true\n})\n\nexport interface IActionFactory extends Annotation, PropertyDecorator {\n    // nameless actions\n    <T extends Function | undefined | null>(fn: T): T\n    // named actions\n    <T extends Function | undefined | null>(name: string, fn: T): T\n\n    // named decorator\n    (customName: string): PropertyDecorator & Annotation\n\n    // decorator (name no longer supported)\n    bound: Annotation & PropertyDecorator\n}\n\nfunction createActionFactory(autoAction: boolean): IActionFactory {\n    const res: IActionFactory = function action(arg1, arg2?): any {\n        // action(fn() {})\n        if (isFunction(arg1)) {\n            return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction)\n        }\n        // action(\"name\", fn() {})\n        if (isFunction(arg2)) {\n            return createAction(arg1, arg2, autoAction)\n        }\n        // @action\n        if (isStringish(arg2)) {\n            return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation)\n        }\n        // action(\"name\") & @action(\"name\")\n        if (isStringish(arg1)) {\n            return createDecoratorAnnotation(\n                createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n                    name: arg1,\n                    autoAction\n                })\n            )\n        }\n\n        if (__DEV__) {\n            die(\"Invalid arguments for `action`\")\n        }\n    } as IActionFactory\n    return res\n}\n\nexport const action: IActionFactory = createActionFactory(false)\nObject.assign(action, actionAnnotation)\nexport const autoAction: IActionFactory = createActionFactory(true)\nObject.assign(autoAction, autoActionAnnotation)\n\naction.bound = createDecoratorAnnotation(actionBoundAnnotation)\nautoAction.bound = createDecoratorAnnotation(autoActionBoundAnnotation)\n\nexport function runInAction<T>(fn: () => T): T {\n    return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined)\n}\n\nexport function isAction(thing: any) {\n    return isFunction(thing) && thing.isMobxAction === true\n}\n","import {\n    EMPTY_OBJECT,\n    IEqualsComparer,\n    IReactionDisposer,\n    IReactionPublic,\n    Lambda,\n    Reaction,\n    action,\n    comparer,\n    getNextId,\n    isAction,\n    isFunction,\n    isPlainObject,\n    die,\n    allowStateChanges\n} from \"../internal\"\n\nexport interface IAutorunOptions {\n    delay?: number\n    name?: string\n    /**\n     * Experimental.\n     * Warns if the view doesn't track observables\n     */\n    requiresObservable?: boolean\n    scheduler?: (callback: () => void) => any\n    onError?: (error: any) => void\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nexport function autorun(\n    view: (r: IReactionPublic) => any,\n    opts: IAutorunOptions = EMPTY_OBJECT\n): IReactionDisposer {\n    if (__DEV__) {\n        if (!isFunction(view)) {\n            die(\"Autorun expects a function as first argument\")\n        }\n        if (isAction(view)) {\n            die(\"Autorun does not accept actions since actions are untrackable\")\n        }\n    }\n\n    const name: string =\n        opts?.name ?? (__DEV__ ? (view as any).name || \"Autorun@\" + getNextId() : \"Autorun\")\n    const runSync = !opts.scheduler && !opts.delay\n    let reaction: Reaction\n\n    if (runSync) {\n        // normal autorun\n        reaction = new Reaction(\n            name,\n            function (this: Reaction) {\n                this.track(reactionRunner)\n            },\n            opts.onError,\n            opts.requiresObservable\n        )\n    } else {\n        const scheduler = createSchedulerFromOptions(opts)\n        // debounced autorun\n        let isScheduled = false\n\n        reaction = new Reaction(\n            name,\n            () => {\n                if (!isScheduled) {\n                    isScheduled = true\n                    scheduler(() => {\n                        isScheduled = false\n                        if (!reaction.isDisposed_) {\n                            reaction.track(reactionRunner)\n                        }\n                    })\n                }\n            },\n            opts.onError,\n            opts.requiresObservable\n        )\n    }\n\n    function reactionRunner() {\n        view(reaction)\n    }\n\n    reaction.schedule_()\n    return reaction.getDisposer_()\n}\n\nexport type IReactionOptions<T, FireImmediately extends boolean> = IAutorunOptions & {\n    fireImmediately?: FireImmediately\n    equals?: IEqualsComparer<T>\n}\n\nconst run = (f: Lambda) => f()\n\nfunction createSchedulerFromOptions(opts: IAutorunOptions) {\n    return opts.scheduler\n        ? opts.scheduler\n        : opts.delay\n        ? (f: Lambda) => setTimeout(f, opts.delay!)\n        : run\n}\n\nexport function reaction<T, FireImmediately extends boolean = false>(\n    expression: (r: IReactionPublic) => T,\n    effect: (\n        arg: T,\n        prev: FireImmediately extends true ? T | undefined : T,\n        r: IReactionPublic\n    ) => void,\n    opts: IReactionOptions<T, FireImmediately> = EMPTY_OBJECT\n): IReactionDisposer {\n    if (__DEV__) {\n        if (!isFunction(expression) || !isFunction(effect)) {\n            die(\"First and second argument to reaction should be functions\")\n        }\n        if (!isPlainObject(opts)) {\n            die(\"Third argument of reactions should be an object\")\n        }\n    }\n    const name = opts.name ?? (__DEV__ ? \"Reaction@\" + getNextId() : \"Reaction\")\n    const effectAction = action(\n        name,\n        opts.onError ? wrapErrorHandler(opts.onError, effect) : effect\n    )\n    const runSync = !opts.scheduler && !opts.delay\n    const scheduler = createSchedulerFromOptions(opts)\n\n    let firstTime = true\n    let isScheduled = false\n    let value: T\n    let oldValue: T | undefined\n\n    const equals: IEqualsComparer<T> = (opts as any).compareStructural\n        ? comparer.structural\n        : opts.equals || comparer.default\n\n    const r = new Reaction(\n        name,\n        () => {\n            if (firstTime || runSync) {\n                reactionRunner()\n            } else if (!isScheduled) {\n                isScheduled = true\n                scheduler!(reactionRunner)\n            }\n        },\n        opts.onError,\n        opts.requiresObservable\n    )\n\n    function reactionRunner() {\n        isScheduled = false\n        if (r.isDisposed_) {\n            return\n        }\n        let changed: boolean = false\n        r.track(() => {\n            const nextValue = allowStateChanges(false, () => expression(r))\n            changed = firstTime || !equals(value, nextValue)\n            oldValue = value\n            value = nextValue\n        })\n\n        // This casting is nesessary as TS cannot infer proper type in current funciton implementation\n        type OldValue = FireImmediately extends true ? T | undefined : T\n        if (firstTime && opts.fireImmediately!) {\n            effectAction(value, oldValue as OldValue, r)\n        } else if (!firstTime && changed) {\n            effectAction(value, oldValue as OldValue, r)\n        }\n        firstTime = false\n    }\n\n    r.schedule_()\n    return r.getDisposer_()\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n    return function () {\n        try {\n            return baseFn.apply(this, arguments)\n        } catch (e) {\n            errorHandler.call(this, e)\n        }\n    }\n}\n","import {\n    IComputedValue,\n    IObservable,\n    IObservableArray,\n    Lambda,\n    ObservableMap,\n    getAtom,\n    ObservableSet,\n    isFunction,\n    IObservableValue\n} from \"../internal\"\n\nconst ON_BECOME_OBSERVED = \"onBO\"\nconst ON_BECOME_UNOBSERVED = \"onBUO\"\n\nexport function onBecomeObserved(\n    value:\n        | IObservable\n        | IComputedValue<any>\n        | IObservableArray<any>\n        | ObservableMap<any, any>\n        | ObservableSet<any>\n        | IObservableValue<any>,\n    listener: Lambda\n): Lambda\nexport function onBecomeObserved<K, V = any>(\n    value: ObservableMap<K, V> | Object,\n    property: K,\n    listener: Lambda\n): Lambda\nexport function onBecomeObserved(thing, arg2, arg3?): Lambda {\n    return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3)\n}\n\nexport function onBecomeUnobserved(\n    value:\n        | IObservable\n        | IComputedValue<any>\n        | IObservableArray<any>\n        | ObservableMap<any, any>\n        | ObservableSet<any>\n        | IObservableValue<any>,\n    listener: Lambda\n): Lambda\nexport function onBecomeUnobserved<K, V = any>(\n    value: ObservableMap<K, V> | Object,\n    property: K,\n    listener: Lambda\n): Lambda\nexport function onBecomeUnobserved(thing, arg2, arg3?): Lambda {\n    return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3)\n}\n\nfunction interceptHook(hook: \"onBO\" | \"onBUO\", thing, arg2, arg3) {\n    const atom: IObservable =\n        typeof arg3 === \"function\" ? getAtom(thing, arg2) : (getAtom(thing) as any)\n    const cb = isFunction(arg3) ? arg3 : arg2\n    const listenersKey = `${hook}L` as \"onBOL\" | \"onBUOL\"\n\n    if (atom[listenersKey]) {\n        atom[listenersKey]!.add(cb)\n    } else {\n        atom[listenersKey] = new Set<Lambda>([cb])\n    }\n\n    return function () {\n        const hookListeners = atom[listenersKey]\n        if (hookListeners) {\n            hookListeners.delete(cb)\n            if (hookListeners.size === 0) {\n                delete atom[listenersKey]\n            }\n        }\n    }\n}\n","import { globalState, isolateGlobalState, setReactionScheduler } from \"../internal\"\n\nconst NEVER = \"never\"\nconst ALWAYS = \"always\"\nconst OBSERVED = \"observed\"\n// const IF_AVAILABLE = \"ifavailable\"\n\nexport function configure(options: {\n    enforceActions?: \"never\" | \"always\" | \"observed\"\n    computedRequiresReaction?: boolean\n    /**\n     * Warn if you try to create to derivation / reactive context without accessing any observable.\n     */\n    reactionRequiresObservable?: boolean\n    /**\n     * Warn if observables are accessed outside a reactive context\n     */\n    observableRequiresReaction?: boolean\n    isolateGlobalState?: boolean\n    disableErrorBoundaries?: boolean\n    safeDescriptors?: boolean\n    reactionScheduler?: (f: () => void) => void\n    useProxies?: \"always\" | \"never\" | \"ifavailable\"\n}): void {\n    if (options.isolateGlobalState === true) {\n        isolateGlobalState()\n    }\n    const { useProxies, enforceActions } = options\n    if (useProxies !== undefined) {\n        globalState.useProxies =\n            useProxies === ALWAYS\n                ? true\n                : useProxies === NEVER\n                ? false\n                : typeof Proxy !== \"undefined\"\n    }\n    if (useProxies === \"ifavailable\") {\n        globalState.verifyProxies = true\n    }\n    if (enforceActions !== undefined) {\n        const ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED\n        globalState.enforceActions = ea\n        globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true\n    }\n    ;[\n        \"computedRequiresReaction\",\n        \"reactionRequiresObservable\",\n        \"observableRequiresReaction\",\n        \"disableErrorBoundaries\",\n        \"safeDescriptors\"\n    ].forEach(key => {\n        if (key in options) {\n            globalState[key] = !!options[key]\n        }\n    })\n    globalState.allowStateReads = !globalState.observableRequiresReaction\n    if (__DEV__ && globalState.disableErrorBoundaries === true) {\n        console.warn(\n            \"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\"\n        )\n    }\n    if (options.reactionScheduler) {\n        setReactionScheduler(options.reactionScheduler)\n    }\n}\n","import {\n    CreateObservableOptions,\n    isObservableMap,\n    AnnotationsMap,\n    startBatch,\n    endBatch,\n    asObservableObject,\n    isPlainObject,\n    ObservableObjectAdministration,\n    isObservable,\n    die,\n    getOwnPropertyDescriptors,\n    $mobx,\n    ownKeys\n} from \"../internal\"\n\nexport function extendObservable<A extends Object, B extends Object>(\n    target: A,\n    properties: B,\n    annotations?: AnnotationsMap<B, never>,\n    options?: CreateObservableOptions\n): A & B {\n    if (__DEV__) {\n        if (arguments.length > 4) {\n            die(\"'extendObservable' expected 2-4 arguments\")\n        }\n        if (typeof target !== \"object\") {\n            die(\"'extendObservable' expects an object as first argument\")\n        }\n        if (isObservableMap(target)) {\n            die(\"'extendObservable' should not be used on maps, use map.merge instead\")\n        }\n        if (!isPlainObject(properties)) {\n            die(`'extendObservable' only accepts plain objects as second argument`)\n        }\n        if (isObservable(properties) || isObservable(annotations)) {\n            die(`Extending an object with another observable (object) is not supported`)\n        }\n    }\n    // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n    const descriptors = getOwnPropertyDescriptors(properties)\n\n    const adm: ObservableObjectAdministration = asObservableObject(target, options)[$mobx]\n    startBatch()\n    try {\n        ownKeys(descriptors).forEach(key => {\n            adm.extend_(\n                key,\n                descriptors[key as any],\n                // must pass \"undefined\" for { key: undefined }\n                !annotations ? true : key in annotations ? annotations[key] : true\n            )\n        })\n    } finally {\n        endBatch()\n    }\n    return target as any\n}\n","import { IDepTreeNode, getAtom, getObservers, hasObservers } from \"../internal\"\n\nexport interface IDependencyTree {\n    name: string\n    dependencies?: IDependencyTree[]\n}\n\nexport interface IObserverTree {\n    name: string\n    observers?: IObserverTree[]\n}\n\nexport function getDependencyTree(thing: any, property?: string): IDependencyTree {\n    return nodeToDependencyTree(getAtom(thing, property))\n}\n\nfunction nodeToDependencyTree(node: IDepTreeNode): IDependencyTree {\n    const result: IDependencyTree = {\n        name: node.name_\n    }\n    if (node.observing_ && node.observing_.length > 0) {\n        result.dependencies = unique(node.observing_).map(nodeToDependencyTree)\n    }\n    return result\n}\n\nexport function getObserverTree(thing: any, property?: string): IObserverTree {\n    return nodeToObserverTree(getAtom(thing, property))\n}\n\nfunction nodeToObserverTree(node: IDepTreeNode): IObserverTree {\n    const result: IObserverTree = {\n        name: node.name_\n    }\n    if (hasObservers(node as any)) {\n        result.observers = Array.from(<any>getObservers(node as any)).map(<any>nodeToObserverTree)\n    }\n    return result\n}\n\nfunction unique<T>(list: T[]): T[] {\n    return Array.from(new Set(list))\n}\n","import {\n    action,\n    noop,\n    die,\n    isFunction,\n    Annotation,\n    isStringish,\n    storeAnnotation,\n    createFlowAnnotation,\n    createDecoratorAnnotation\n} from \"../internal\"\n\nexport const FLOW = \"flow\"\n\nlet generatorId = 0\n\nexport function FlowCancellationError() {\n    this.message = \"FLOW_CANCELLED\"\n}\nFlowCancellationError.prototype = Object.create(Error.prototype)\n\nexport function isFlowCancellationError(error: Error) {\n    return error instanceof FlowCancellationError\n}\n\nexport type CancellablePromise<T> = Promise<T> & { cancel(): void }\n\ninterface Flow extends Annotation, PropertyDecorator {\n    <R, Args extends any[]>(\n        generator: (...args: Args) => Generator<any, R, any> | AsyncGenerator<any, R, any>\n    ): (...args: Args) => CancellablePromise<R>\n    bound: Annotation & PropertyDecorator\n}\n\nconst flowAnnotation = createFlowAnnotation(\"flow\")\nconst flowBoundAnnotation = createFlowAnnotation(\"flow.bound\", { bound: true })\n\nexport const flow: Flow = Object.assign(\n    function flow(arg1, arg2?) {\n        // @flow\n        if (isStringish(arg2)) {\n            return storeAnnotation(arg1, arg2, flowAnnotation)\n        }\n        // flow(fn)\n        if (__DEV__ && arguments.length !== 1) {\n            die(`Flow expects single argument with generator function`)\n        }\n        const generator = arg1\n        const name = generator.name || \"<unnamed flow>\"\n\n        // Implementation based on https://github.com/tj/co/blob/master/index.js\n        const res = function () {\n            const ctx = this\n            const args = arguments\n            const runId = ++generatorId\n            const gen = action(`${name} - runid: ${runId} - init`, generator).apply(ctx, args)\n            let rejector: (error: any) => void\n            let pendingPromise: CancellablePromise<any> | undefined = undefined\n\n            const promise = new Promise(function (resolve, reject) {\n                let stepId = 0\n                rejector = reject\n\n                function onFulfilled(res: any) {\n                    pendingPromise = undefined\n                    let ret\n                    try {\n                        ret = action(\n                            `${name} - runid: ${runId} - yield ${stepId++}`,\n                            gen.next\n                        ).call(gen, res)\n                    } catch (e) {\n                        return reject(e)\n                    }\n\n                    next(ret)\n                }\n\n                function onRejected(err: any) {\n                    pendingPromise = undefined\n                    let ret\n                    try {\n                        ret = action(\n                            `${name} - runid: ${runId} - yield ${stepId++}`,\n                            gen.throw!\n                        ).call(gen, err)\n                    } catch (e) {\n                        return reject(e)\n                    }\n                    next(ret)\n                }\n\n                function next(ret: any) {\n                    if (isFunction(ret?.then)) {\n                        // an async iterator\n                        ret.then(next, reject)\n                        return\n                    }\n                    if (ret.done) {\n                        return resolve(ret.value)\n                    }\n                    pendingPromise = Promise.resolve(ret.value) as any\n                    return pendingPromise!.then(onFulfilled, onRejected)\n                }\n\n                onFulfilled(undefined) // kick off the process\n            }) as any\n\n            promise.cancel = action(`${name} - runid: ${runId} - cancel`, function () {\n                try {\n                    if (pendingPromise) {\n                        cancelPromise(pendingPromise)\n                    }\n                    // Finally block can return (or yield) stuff..\n                    const res = gen.return!(undefined as any)\n                    // eat anything that promise would do, it's cancelled!\n                    const yieldedPromise = Promise.resolve(res.value)\n                    yieldedPromise.then(noop, noop)\n                    cancelPromise(yieldedPromise) // maybe it can be cancelled :)\n                    // reject our original promise\n                    rejector(new FlowCancellationError())\n                } catch (e) {\n                    rejector(e) // there could be a throwing finally block\n                }\n            })\n            return promise\n        }\n        res.isMobXFlow = true\n        return res\n    } as any,\n    flowAnnotation\n)\n\nflow.bound = createDecoratorAnnotation(flowBoundAnnotation)\n\nfunction cancelPromise(promise) {\n    if (isFunction(promise.cancel)) {\n        promise.cancel()\n    }\n}\n\nexport function flowResult<T>(\n    result: T\n): T extends Generator<any, infer R, any>\n    ? CancellablePromise<R>\n    : T extends CancellablePromise<any>\n    ? T\n    : never {\n    return result as any // just tricking TypeScript :)\n}\n\nexport function isFlow(fn: any): boolean {\n    return fn?.isMobXFlow === true\n}\n","import {\n    IObservableArray,\n    IObservableValue,\n    Lambda,\n    ObservableMap,\n    getAdministration,\n    isObservableArray,\n    isObservableMap,\n    isObservableObject,\n    isObservableValue,\n    ObservableSet,\n    die,\n    isStringish\n} from \"../internal\"\n\nexport type ReadInterceptor<T> = (value: any) => T\n\n/** Experimental feature right now, tested indirectly via Mobx-State-Tree */\nexport function interceptReads<T>(value: IObservableValue<T>, handler: ReadInterceptor<T>): Lambda\nexport function interceptReads<T>(\n    observableArray: IObservableArray<T>,\n    handler: ReadInterceptor<T>\n): Lambda\nexport function interceptReads<K, V>(\n    observableMap: ObservableMap<K, V>,\n    handler: ReadInterceptor<V>\n): Lambda\nexport function interceptReads<V>(\n    observableSet: ObservableSet<V>,\n    handler: ReadInterceptor<V>\n): Lambda\nexport function interceptReads(\n    object: Object,\n    property: string,\n    handler: ReadInterceptor<any>\n): Lambda\nexport function interceptReads(thing, propOrHandler?, handler?): Lambda {\n    let target\n    if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n        target = getAdministration(thing)\n    } else if (isObservableObject(thing)) {\n        if (__DEV__ && !isStringish(propOrHandler)) {\n            return die(\n                `InterceptReads can only be used with a specific property, not with an object in general`\n            )\n        }\n        target = getAdministration(thing, propOrHandler)\n    } else if (__DEV__) {\n        return die(`Expected observable map, object or array as first array`)\n    }\n    if (__DEV__ && target.dehancer !== undefined) {\n        return die(`An intercept reader was already established`)\n    }\n    target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler\n    return () => {\n        target.dehancer = undefined\n    }\n}\n","import {\n    IArrayWillChange,\n    IArrayWillSplice,\n    IInterceptor,\n    IMapWillChange,\n    IObjectWillChange,\n    IObservableArray,\n    IObservableValue,\n    IValueWillChange,\n    Lambda,\n    ObservableMap,\n    getAdministration,\n    ObservableSet,\n    ISetWillChange,\n    isFunction\n} from \"../internal\"\n\nexport function intercept<T>(\n    value: IObservableValue<T>,\n    handler: IInterceptor<IValueWillChange<T>>\n): Lambda\nexport function intercept<T>(\n    observableArray: IObservableArray<T> | Array<T>,\n    handler: IInterceptor<IArrayWillChange<T> | IArrayWillSplice<T>>\n): Lambda\nexport function intercept<K, V>(\n    observableMap: ObservableMap<K, V> | Map<K, V>,\n    handler: IInterceptor<IMapWillChange<K, V>>\n): Lambda\nexport function intercept<V>(\n    observableSet: ObservableSet<V> | Set<V>,\n    handler: IInterceptor<ISetWillChange<V>>\n): Lambda\nexport function intercept<K, V>(\n    observableMap: ObservableMap<K, V> | Map<K, V>,\n    property: K,\n    handler: IInterceptor<IValueWillChange<V>>\n): Lambda\nexport function intercept(object: object, handler: IInterceptor<IObjectWillChange>): Lambda\nexport function intercept<T extends object, K extends keyof T>(\n    object: T,\n    property: K,\n    handler: IInterceptor<IValueWillChange<T[K]>>\n): Lambda\nexport function intercept(thing, propOrHandler?, handler?): Lambda {\n    if (isFunction(handler)) {\n        return interceptProperty(thing, propOrHandler, handler)\n    } else {\n        return interceptInterceptable(thing, propOrHandler)\n    }\n}\n\nfunction interceptInterceptable(thing, handler) {\n    return getAdministration(thing).intercept_(handler)\n}\n\nfunction interceptProperty(thing, property, handler) {\n    return getAdministration(thing, property).intercept_(handler)\n}\n","import { $mobx, getAtom, isComputedValue, isObservableObject, die, isStringish } from \"../internal\"\n\nexport function _isComputed(value, property?: PropertyKey): boolean {\n    if (property === undefined) {\n        return isComputedValue(value)\n    }\n    if (isObservableObject(value) === false) {\n        return false\n    }\n    if (!value[$mobx].values_.has(property)) {\n        return false\n    }\n    const atom = getAtom(value, property)\n    return isComputedValue(atom)\n}\n\nexport function isComputed(value: any): boolean {\n    if (__DEV__ && arguments.length > 1) {\n        return die(\n            `isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property`\n        )\n    }\n    return _isComputed(value)\n}\n\nexport function isComputedProp(value: any, propName: PropertyKey): boolean {\n    if (__DEV__ && !isStringish(propName)) {\n        return die(`isComputed expected a property name as second argument`)\n    }\n    return _isComputed(value, propName)\n}\n","import {\n    $mobx,\n    isAtom,\n    isComputedValue,\n    isObservableArray,\n    isObservableMap,\n    isObservableObject,\n    isReaction,\n    die,\n    isStringish\n} from \"../internal\"\n\nfunction _isObservable(value, property?: PropertyKey): boolean {\n    if (!value) {\n        return false\n    }\n    if (property !== undefined) {\n        if (__DEV__ && (isObservableMap(value) || isObservableArray(value))) {\n            return die(\n                \"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\"\n            )\n        }\n        if (isObservableObject(value)) {\n            return value[$mobx].values_.has(property)\n        }\n        return false\n    }\n    // For first check, see #701\n    return (\n        isObservableObject(value) ||\n        !!value[$mobx] ||\n        isAtom(value) ||\n        isReaction(value) ||\n        isComputedValue(value)\n    )\n}\n\nexport function isObservable(value: any): boolean {\n    if (__DEV__ && arguments.length !== 1) {\n        die(\n            `isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property`\n        )\n    }\n    return _isObservable(value)\n}\n\nexport function isObservableProp(value: any, propName: PropertyKey): boolean {\n    if (__DEV__ && !isStringish(propName)) {\n        return die(`expected a property name as second argument`)\n    }\n    return _isObservable(value, propName)\n}\n","import {\n    $mobx,\n    IIsObservableObject,\n    IObservableArray,\n    ObservableMap,\n    ObservableSet,\n    ObservableObjectAdministration,\n    endBatch,\n    isObservableArray,\n    isObservableMap,\n    isObservableSet,\n    isObservableObject,\n    startBatch,\n    die\n} from \"../internal\"\n\nexport function keys<K>(map: ObservableMap<K, any>): ReadonlyArray<K>\nexport function keys<T>(ar: IObservableArray<T>): ReadonlyArray<number>\nexport function keys<T>(set: ObservableSet<T>): ReadonlyArray<T>\nexport function keys<T extends Object>(obj: T): ReadonlyArray<PropertyKey>\nexport function keys(obj: any): any {\n    if (isObservableObject(obj)) {\n        return (\n            (obj as any as IIsObservableObject)[$mobx] as ObservableObjectAdministration\n        ).keys_()\n    }\n    if (isObservableMap(obj) || isObservableSet(obj)) {\n        return Array.from(obj.keys())\n    }\n    if (isObservableArray(obj)) {\n        return obj.map((_, index) => index)\n    }\n    die(5)\n}\n\nexport function values<K, T>(map: ObservableMap<K, T>): ReadonlyArray<T>\nexport function values<T>(set: ObservableSet<T>): ReadonlyArray<T>\nexport function values<T>(ar: IObservableArray<T>): ReadonlyArray<T>\nexport function values<T = any>(obj: T): ReadonlyArray<T extends object ? T[keyof T] : any>\nexport function values(obj: any): string[] {\n    if (isObservableObject(obj)) {\n        return keys(obj).map(key => obj[key])\n    }\n    if (isObservableMap(obj)) {\n        return keys(obj).map(key => obj.get(key))\n    }\n    if (isObservableSet(obj)) {\n        return Array.from(obj.values())\n    }\n    if (isObservableArray(obj)) {\n        return obj.slice()\n    }\n    die(6)\n}\n\nexport function entries<K, T>(map: ObservableMap<K, T>): ReadonlyArray<[K, T]>\nexport function entries<T>(set: ObservableSet<T>): ReadonlyArray<[T, T]>\nexport function entries<T>(ar: IObservableArray<T>): ReadonlyArray<[number, T]>\nexport function entries<T = any>(\n    obj: T\n): ReadonlyArray<[string, T extends object ? T[keyof T] : any]>\nexport function entries(obj: any): any {\n    if (isObservableObject(obj)) {\n        return keys(obj).map(key => [key, obj[key]])\n    }\n    if (isObservableMap(obj)) {\n        return keys(obj).map(key => [key, obj.get(key)])\n    }\n    if (isObservableSet(obj)) {\n        return Array.from(obj.entries())\n    }\n    if (isObservableArray(obj)) {\n        return obj.map((key, index) => [index, key])\n    }\n    die(7)\n}\n\nexport function set<V>(obj: ObservableMap<PropertyKey, V>, values: { [key: string]: V })\nexport function set<K, V>(obj: ObservableMap<K, V>, key: K, value: V)\nexport function set<T>(obj: ObservableSet<T>, value: T)\nexport function set<T>(obj: IObservableArray<T>, index: number, value: T)\nexport function set<T extends Object>(obj: T, values: { [key: string]: any })\nexport function set<T extends Object>(obj: T, key: PropertyKey, value: any)\nexport function set(obj: any, key: any, value?: any): void {\n    if (arguments.length === 2 && !isObservableSet(obj)) {\n        startBatch()\n        const values = key\n        try {\n            for (let key in values) {\n                set(obj, key, values[key])\n            }\n        } finally {\n            endBatch()\n        }\n        return\n    }\n    if (isObservableObject(obj)) {\n        ;(obj as any as IIsObservableObject)[$mobx].set_(key, value)\n    } else if (isObservableMap(obj)) {\n        obj.set(key, value)\n    } else if (isObservableSet(obj)) {\n        obj.add(key)\n    } else if (isObservableArray(obj)) {\n        if (typeof key !== \"number\") {\n            key = parseInt(key, 10)\n        }\n        if (key < 0) {\n            die(`Invalid index: '${key}'`)\n        }\n        startBatch()\n        if (key >= obj.length) {\n            obj.length = key + 1\n        }\n        obj[key] = value\n        endBatch()\n    } else {\n        die(8)\n    }\n}\n\nexport function remove<K, V>(obj: ObservableMap<K, V>, key: K)\nexport function remove<T>(obj: ObservableSet<T>, key: T)\nexport function remove<T>(obj: IObservableArray<T>, index: number)\nexport function remove<T extends Object>(obj: T, key: string)\nexport function remove(obj: any, key: any): void {\n    if (isObservableObject(obj)) {\n        ;(obj as any as IIsObservableObject)[$mobx].delete_(key)\n    } else if (isObservableMap(obj)) {\n        obj.delete(key)\n    } else if (isObservableSet(obj)) {\n        obj.delete(key)\n    } else if (isObservableArray(obj)) {\n        if (typeof key !== \"number\") {\n            key = parseInt(key, 10)\n        }\n        obj.splice(key, 1)\n    } else {\n        die(9)\n    }\n}\n\nexport function has<K>(obj: ObservableMap<K, any>, key: K): boolean\nexport function has<T>(obj: ObservableSet<T>, key: T): boolean\nexport function has<T>(obj: IObservableArray<T>, index: number): boolean\nexport function has<T extends Object>(obj: T, key: string): boolean\nexport function has(obj: any, key: any): boolean {\n    if (isObservableObject(obj)) {\n        return (obj as any as IIsObservableObject)[$mobx].has_(key)\n    } else if (isObservableMap(obj)) {\n        return obj.has(key)\n    } else if (isObservableSet(obj)) {\n        return obj.has(key)\n    } else if (isObservableArray(obj)) {\n        return key >= 0 && key < obj.length\n    }\n    die(10)\n}\n\nexport function get<K, V>(obj: ObservableMap<K, V>, key: K): V | undefined\nexport function get<T>(obj: IObservableArray<T>, index: number): T | undefined\nexport function get<T extends Object>(obj: T, key: string): any\nexport function get(obj: any, key: any): any {\n    if (!has(obj, key)) {\n        return undefined\n    }\n    if (isObservableObject(obj)) {\n        return (obj as any as IIsObservableObject)[$mobx].get_(key)\n    } else if (isObservableMap(obj)) {\n        return obj.get(key)\n    } else if (isObservableArray(obj)) {\n        return obj[key]\n    }\n    die(11)\n}\n\nexport function apiDefineProperty(obj: Object, key: PropertyKey, descriptor: PropertyDescriptor) {\n    if (isObservableObject(obj)) {\n        return (obj as any as IIsObservableObject)[$mobx].defineProperty_(key, descriptor)\n    }\n    die(39)\n}\n\nexport function apiOwnKeys(obj: Object) {\n    if (isObservableObject(obj)) {\n        return (obj as any as IIsObservableObject)[$mobx].ownKeys_()\n    }\n    die(38)\n}\n","import {\n    IArrayDidChange,\n    IComputedValue,\n    IMapDidChange,\n    IObjectDidChange,\n    IObservableArray,\n    IObservableValue,\n    IValueDidChange,\n    Lambda,\n    ObservableMap,\n    getAdministration,\n    ObservableSet,\n    ISetDidChange,\n    isFunction\n} from \"../internal\"\n\nexport function observe<T>(\n    value: IObservableValue<T> | IComputedValue<T>,\n    listener: (change: IValueDidChange<T>) => void,\n    fireImmediately?: boolean\n): Lambda\nexport function observe<T>(\n    observableArray: IObservableArray<T> | Array<T>,\n    listener: (change: IArrayDidChange<T>) => void,\n    fireImmediately?: boolean\n): Lambda\nexport function observe<V>(\n    // ObservableSet/ObservableMap are required despite they implement Set/Map: https://github.com/mobxjs/mobx/pull/3180#discussion_r746542929\n    observableSet: ObservableSet<V> | Set<V>,\n    listener: (change: ISetDidChange<V>) => void,\n    fireImmediately?: boolean\n): Lambda\nexport function observe<K, V>(\n    observableMap: ObservableMap<K, V> | Map<K, V>,\n    listener: (change: IMapDidChange<K, V>) => void,\n    fireImmediately?: boolean\n): Lambda\nexport function observe<K, V>(\n    observableMap: ObservableMap<K, V> | Map<K, V>,\n    property: K,\n    listener: (change: IValueDidChange<V>) => void,\n    fireImmediately?: boolean\n): Lambda\nexport function observe(\n    object: Object,\n    listener: (change: IObjectDidChange) => void,\n    fireImmediately?: boolean\n): Lambda\nexport function observe<T, K extends keyof T>(\n    object: T,\n    property: K,\n    listener: (change: IValueDidChange<T[K]>) => void,\n    fireImmediately?: boolean\n): Lambda\nexport function observe(thing, propOrCb?, cbOrFire?, fireImmediately?): Lambda {\n    if (isFunction(cbOrFire)) {\n        return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately)\n    } else {\n        return observeObservable(thing, propOrCb, cbOrFire)\n    }\n}\n\nfunction observeObservable(thing, listener, fireImmediately: boolean) {\n    return getAdministration(thing).observe_(listener, fireImmediately)\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately: boolean) {\n    return getAdministration(thing, property).observe_(listener, fireImmediately)\n}\n","import {\n    isObservable,\n    isObservableArray,\n    isObservableValue,\n    isObservableMap,\n    isObservableSet,\n    isComputedValue,\n    die,\n    apiOwnKeys,\n    objectPrototype\n} from \"../internal\"\n\nfunction cache<K, V>(map: Map<any, any>, key: K, value: V): V {\n    map.set(key, value)\n    return value\n}\n\nfunction toJSHelper(source, __alreadySeen: Map<any, any>) {\n    if (\n        source == null ||\n        typeof source !== \"object\" ||\n        source instanceof Date ||\n        !isObservable(source)\n    ) {\n        return source\n    }\n\n    if (isObservableValue(source) || isComputedValue(source)) {\n        return toJSHelper(source.get(), __alreadySeen)\n    }\n    if (__alreadySeen.has(source)) {\n        return __alreadySeen.get(source)\n    }\n    if (isObservableArray(source)) {\n        const res = cache(__alreadySeen, source, new Array(source.length))\n        source.forEach((value, idx) => {\n            res[idx] = toJSHelper(value, __alreadySeen)\n        })\n        return res\n    }\n    if (isObservableSet(source)) {\n        const res = cache(__alreadySeen, source, new Set())\n        source.forEach(value => {\n            res.add(toJSHelper(value, __alreadySeen))\n        })\n        return res\n    }\n    if (isObservableMap(source)) {\n        const res = cache(__alreadySeen, source, new Map())\n        source.forEach((value, key) => {\n            res.set(key, toJSHelper(value, __alreadySeen))\n        })\n        return res\n    } else {\n        // must be observable object\n        const res = cache(__alreadySeen, source, {})\n        apiOwnKeys(source).forEach((key: any) => {\n            if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n                res[key] = toJSHelper(source[key], __alreadySeen)\n            }\n        })\n        return res\n    }\n}\n\n/**\n * Recursively converts an observable to it's non-observable native counterpart.\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\n * Computed and other non-enumerable properties are completely ignored.\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\n */\nexport function toJS<T>(source: T, options?: any): T {\n    if (__DEV__ && options) {\n        die(\"toJS no longer supports options\")\n    }\n    return toJSHelper(source, new Map())\n}\n","import { TraceMode, die, getAtom, globalState } from \"../internal\"\n\nexport function trace(thing?: any, prop?: string, enterBreakPoint?: boolean): void\nexport function trace(thing?: any, enterBreakPoint?: boolean): void\nexport function trace(enterBreakPoint?: boolean): void\nexport function trace(...args: any[]): void {\n    if (!__DEV__) {\n        die(`trace() is not available in production builds`)\n    }\n    let enterBreakPoint = false\n    if (typeof args[args.length - 1] === \"boolean\") {\n        enterBreakPoint = args.pop()\n    }\n    const derivation = getAtomFromArgs(args)\n    if (!derivation) {\n        return die(\n            `'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly`\n        )\n    }\n    if (derivation.isTracing_ === TraceMode.NONE) {\n        console.log(`[mobx.trace] '${derivation.name_}' tracing enabled`)\n    }\n    derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG\n}\n\nfunction getAtomFromArgs(args): any {\n    switch (args.length) {\n        case 0:\n            return globalState.trackingDerivation\n        case 1:\n            return getAtom(args[0])\n        case 2:\n            return getAtom(args[0], args[1])\n    }\n}\n","import { endBatch, startBatch } from \"../internal\"\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nexport function transaction<T>(action: () => T, thisArg = undefined): T {\n    startBatch()\n    try {\n        return action.apply(thisArg)\n    } finally {\n        endBatch()\n    }\n}\n","import {\n    $mobx,\n    IReactionDisposer,\n    Lambda,\n    autorun,\n    createAction,\n    getNextId,\n    die,\n    allowStateChanges\n} from \"../internal\"\n\nexport interface IWhenOptions {\n    name?: string\n    timeout?: number\n    onError?: (error: any) => void\n}\n\nexport function when(\n    predicate: () => boolean,\n    opts?: IWhenOptions\n): Promise<void> & { cancel(): void }\nexport function when(\n    predicate: () => boolean,\n    effect: Lambda,\n    opts?: IWhenOptions\n): IReactionDisposer\nexport function when(predicate: any, arg1?: any, arg2?: any): any {\n    if (arguments.length === 1 || (arg1 && typeof arg1 === \"object\")) {\n        return whenPromise(predicate, arg1)\n    }\n    return _when(predicate, arg1, arg2 || {})\n}\n\nfunction _when(predicate: () => boolean, effect: Lambda, opts: IWhenOptions): IReactionDisposer {\n    let timeoutHandle: any\n    if (typeof opts.timeout === \"number\") {\n        const error = new Error(\"WHEN_TIMEOUT\")\n        timeoutHandle = setTimeout(() => {\n            if (!disposer[$mobx].isDisposed_) {\n                disposer()\n                if (opts.onError) {\n                    opts.onError(error)\n                } else {\n                    throw error\n                }\n            }\n        }, opts.timeout)\n    }\n\n    opts.name = __DEV__ ? opts.name || \"When@\" + getNextId() : \"When\"\n    const effectAction = createAction(\n        __DEV__ ? opts.name + \"-effect\" : \"When-effect\",\n        effect as Function\n    )\n    // eslint-disable-next-line\n    var disposer = autorun(r => {\n        // predicate should not change state\n        let cond = allowStateChanges(false, predicate)\n        if (cond) {\n            r.dispose()\n            if (timeoutHandle) {\n                clearTimeout(timeoutHandle)\n            }\n            effectAction()\n        }\n    }, opts)\n    return disposer\n}\n\nfunction whenPromise(\n    predicate: () => boolean,\n    opts?: IWhenOptions\n): Promise<void> & { cancel(): void } {\n    if (__DEV__ && opts && opts.onError) {\n        return die(`the options 'onError' and 'promise' cannot be combined`)\n    }\n    let cancel\n    const res = new Promise((resolve, reject) => {\n        let disposer = _when(predicate, resolve as Lambda, { ...opts, onError: reject })\n        cancel = () => {\n            disposer()\n            reject(new Error(\"WHEN_CANCELLED\"))\n        }\n    })\n    ;(res as any).cancel = cancel\n    return res as any\n}\n","import {\n    $mobx,\n    IIsObservableObject,\n    ObservableObjectAdministration,\n    warnAboutProxyRequirement,\n    assertProxies,\n    die,\n    isStringish,\n    globalState,\n    CreateObservableOptions,\n    asObservableObject\n} from \"../internal\"\n\nfunction getAdm(target): ObservableObjectAdministration {\n    return target[$mobx]\n}\n\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nconst objectProxyTraps: ProxyHandler<any> = {\n    has(target: IIsObservableObject, name: PropertyKey): boolean {\n        if (__DEV__ && globalState.trackingDerivation) {\n            warnAboutProxyRequirement(\n                \"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\"\n            )\n        }\n        return getAdm(target).has_(name)\n    },\n    get(target: IIsObservableObject, name: PropertyKey): any {\n        return getAdm(target).get_(name)\n    },\n    set(target: IIsObservableObject, name: PropertyKey, value: any): boolean {\n        if (!isStringish(name)) {\n            return false\n        }\n        if (__DEV__ && !getAdm(target).values_.has(name)) {\n            warnAboutProxyRequirement(\n                \"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\"\n            )\n        }\n        // null (intercepted) -> true (success)\n        return getAdm(target).set_(name, value, true) ?? true\n    },\n    deleteProperty(target: IIsObservableObject, name: PropertyKey): boolean {\n        if (__DEV__) {\n            warnAboutProxyRequirement(\n                \"delete properties from an observable object. Use 'remove' from 'mobx' instead.\"\n            )\n        }\n        if (!isStringish(name)) {\n            return false\n        }\n        // null (intercepted) -> true (success)\n        return getAdm(target).delete_(name, true) ?? true\n    },\n    defineProperty(\n        target: IIsObservableObject,\n        name: PropertyKey,\n        descriptor: PropertyDescriptor\n    ): boolean {\n        if (__DEV__) {\n            warnAboutProxyRequirement(\n                \"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\"\n            )\n        }\n        // null (intercepted) -> true (success)\n        return getAdm(target).defineProperty_(name, descriptor) ?? true\n    },\n    ownKeys(target: IIsObservableObject): ArrayLike<string | symbol> {\n        if (__DEV__ && globalState.trackingDerivation) {\n            warnAboutProxyRequirement(\n                \"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\"\n            )\n        }\n        return getAdm(target).ownKeys_()\n    },\n    preventExtensions(target) {\n        die(13)\n    }\n}\n\nexport function asDynamicObservableObject(\n    target: any,\n    options?: CreateObservableOptions\n): IIsObservableObject {\n    assertProxies()\n    target = asObservableObject(target, options)\n    return (target[$mobx].proxy_ ??= new Proxy(target, objectProxyTraps))\n}\n","import { Lambda, once, untrackedEnd, untrackedStart, die } from \"../internal\"\n\nexport type IInterceptor<T> = (change: T) => T | null\n\nexport interface IInterceptable<T> {\n    interceptors_: IInterceptor<T>[] | undefined\n}\n\nexport function hasInterceptors(interceptable: IInterceptable<any>) {\n    return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0\n}\n\nexport function registerInterceptor<T>(\n    interceptable: IInterceptable<T>,\n    handler: IInterceptor<T>\n): Lambda {\n    const interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = [])\n    interceptors.push(handler)\n    return once(() => {\n        const idx = interceptors.indexOf(handler)\n        if (idx !== -1) {\n            interceptors.splice(idx, 1)\n        }\n    })\n}\n\nexport function interceptChange<T>(\n    interceptable: IInterceptable<T | null>,\n    change: T | null\n): T | null {\n    const prevU = untrackedStart()\n    try {\n        // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n        const interceptors = [...(interceptable.interceptors_ || [])]\n        for (let i = 0, l = interceptors.length; i < l; i++) {\n            change = interceptors[i](change)\n            if (change && !(change as any).type) {\n                die(14)\n            }\n            if (!change) {\n                break\n            }\n        }\n        return change\n    } finally {\n        untrackedEnd(prevU)\n    }\n}\n","import { Lambda, once, untrackedEnd, untrackedStart } from \"../internal\"\n\nexport interface IListenable {\n    changeListeners_: Function[] | undefined\n}\n\nexport function hasListeners(listenable: IListenable) {\n    return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0\n}\n\nexport function registerListener(listenable: IListenable, handler: Function): Lambda {\n    const listeners = listenable.changeListeners_ || (listenable.changeListeners_ = [])\n    listeners.push(handler)\n    return once(() => {\n        const idx = listeners.indexOf(handler)\n        if (idx !== -1) {\n            listeners.splice(idx, 1)\n        }\n    })\n}\n\nexport function notifyListeners<T>(listenable: IListenable, change: T) {\n    const prevU = untrackedStart()\n    let listeners = listenable.changeListeners_\n    if (!listeners) {\n        return\n    }\n    listeners = listeners.slice()\n    for (let i = 0, l = listeners.length; i < l; i++) {\n        listeners[i](change)\n    }\n    untrackedEnd(prevU)\n}\n","import {\n    $mobx,\n    asObservableObject,\n    AnnotationsMap,\n    endBatch,\n    startBatch,\n    CreateObservableOptions,\n    ObservableObjectAdministration,\n    collectStoredAnnotations,\n    isPlainObject,\n    isObservableObject,\n    die,\n    ownKeys,\n    extendObservable,\n    addHiddenProp,\n    storedAnnotationsSymbol\n} from \"../internal\"\n\n// Hack based on https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-322267089\n// We need this, because otherwise, AdditionalKeys is going to be inferred to be any\n// set of superfluous keys. But, we rather want to get a compile error unless AdditionalKeys is\n// _explicity_ passed as generic argument\n// Fixes: https://github.com/mobxjs/mobx/issues/2325#issuecomment-691070022\ntype NoInfer<T> = [T][T extends any ? 0 : never]\n\nexport function makeObservable<T extends object, AdditionalKeys extends PropertyKey = never>(\n    target: T,\n    annotations?: AnnotationsMap<T, NoInfer<AdditionalKeys>>,\n    options?: CreateObservableOptions\n): T {\n    const adm: ObservableObjectAdministration = asObservableObject(target, options)[$mobx]\n    startBatch()\n    try {\n        if (__DEV__ && annotations && target[storedAnnotationsSymbol]) {\n            die(\n                `makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.`\n            )\n        }\n        // Default to decorators\n        annotations ??= collectStoredAnnotations(target)\n\n        // Annotate\n        ownKeys(annotations).forEach(key => adm.make_(key, annotations![key]))\n    } finally {\n        endBatch()\n    }\n    return target\n}\n\n// proto[keysSymbol] = new Set<PropertyKey>()\nconst keysSymbol = Symbol(\"mobx-keys\")\n\nexport function makeAutoObservable<T extends object, AdditionalKeys extends PropertyKey = never>(\n    target: T,\n    overrides?: AnnotationsMap<T, NoInfer<AdditionalKeys>>,\n    options?: CreateObservableOptions\n): T {\n    if (__DEV__) {\n        if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n            die(`'makeAutoObservable' can only be used for classes that don't have a superclass`)\n        }\n        if (isObservableObject(target)) {\n            die(`makeAutoObservable can only be used on objects not already made observable`)\n        }\n    }\n\n    // Optimization: avoid visiting protos\n    // Assumes that annotation.make_/.extend_ works the same for plain objects\n    if (isPlainObject(target)) {\n        return extendObservable(target, target, overrides, options)\n    }\n\n    const adm: ObservableObjectAdministration = asObservableObject(target, options)[$mobx]\n\n    // Optimization: cache keys on proto\n    // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n    if (!target[keysSymbol]) {\n        const proto = Object.getPrototypeOf(target)\n        const keys = new Set([...ownKeys(target), ...ownKeys(proto)])\n        keys.delete(\"constructor\")\n        keys.delete($mobx)\n        addHiddenProp(proto, keysSymbol, keys)\n    }\n\n    startBatch()\n    try {\n        target[keysSymbol].forEach(key =>\n            adm.make_(\n                key,\n                // must pass \"undefined\" for { key: undefined }\n                !overrides ? true : key in overrides ? overrides[key] : true\n            )\n        )\n    } finally {\n        endBatch()\n    }\n    return target\n}\n","import {\n    $mobx,\n    Atom,\n    EMPTY_ARRAY,\n    IAtom,\n    IEnhancer,\n    IInterceptable,\n    IInterceptor,\n    IListenable,\n    Lambda,\n    addHiddenFinalProp,\n    checkIfStateModificationsAreAllowed,\n    createInstanceofPredicate,\n    getNextId,\n    hasInterceptors,\n    hasListeners,\n    interceptChange,\n    isObject,\n    isSpyEnabled,\n    notifyListeners,\n    registerInterceptor,\n    registerListener,\n    spyReportEnd,\n    spyReportStart,\n    allowStateChangesStart,\n    allowStateChangesEnd,\n    assertProxies,\n    reserveArrayBuffer,\n    hasProp,\n    die,\n    globalState\n} from \"../internal\"\n\nconst SPLICE = \"splice\"\nexport const UPDATE = \"update\"\nexport const MAX_SPLICE_SIZE = 10000 // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nexport interface IObservableArray<T = any> extends Array<T> {\n    spliceWithArray(index: number, deleteCount?: number, newItems?: T[]): T[]\n    clear(): T[]\n    replace(newItems: T[]): T[]\n    remove(value: T): boolean\n    toJSON(): T[]\n}\n\ninterface IArrayBaseChange<T> {\n    object: IObservableArray<T>\n    observableKind: \"array\"\n    debugObjectName: string\n    index: number\n}\n\nexport type IArrayDidChange<T = any> = IArrayUpdate<T> | IArraySplice<T>\n\nexport interface IArrayUpdate<T = any> extends IArrayBaseChange<T> {\n    type: \"update\"\n    newValue: T\n    oldValue: T\n}\n\nexport interface IArraySplice<T = any> extends IArrayBaseChange<T> {\n    type: \"splice\"\n    added: T[]\n    addedCount: number\n    removed: T[]\n    removedCount: number\n}\n\nexport interface IArrayWillChange<T = any> {\n    object: IObservableArray<T>\n    index: number\n    type: \"update\"\n    newValue: T\n}\n\nexport interface IArrayWillSplice<T = any> {\n    object: IObservableArray<T>\n    index: number\n    type: \"splice\"\n    added: T[]\n    removedCount: number\n}\n\nconst arrayTraps = {\n    get(target, name) {\n        const adm: ObservableArrayAdministration = target[$mobx]\n        if (name === $mobx) {\n            return adm\n        }\n        if (name === \"length\") {\n            return adm.getArrayLength_()\n        }\n        if (typeof name === \"string\" && !isNaN(name as any)) {\n            return adm.get_(parseInt(name))\n        }\n        if (hasProp(arrayExtensions, name)) {\n            return arrayExtensions[name]\n        }\n        return target[name]\n    },\n    set(target, name, value): boolean {\n        const adm: ObservableArrayAdministration = target[$mobx]\n        if (name === \"length\") {\n            adm.setArrayLength_(value)\n        }\n        if (typeof name === \"symbol\" || isNaN(name)) {\n            target[name] = value\n        } else {\n            // numeric string\n            adm.set_(parseInt(name), value)\n        }\n        return true\n    },\n    preventExtensions() {\n        die(15)\n    }\n}\n\nexport class ObservableArrayAdministration\n    implements IInterceptable<IArrayWillChange<any> | IArrayWillSplice<any>>, IListenable\n{\n    atom_: IAtom\n    readonly values_: any[] = [] // this is the prop that gets proxied, so can't replace it!\n    interceptors_\n    changeListeners_\n    enhancer_: (newV: any, oldV: any | undefined) => any\n    dehancer: any\n    proxy_!: IObservableArray<any>\n    lastKnownLength_ = 0\n\n    constructor(\n        name = __DEV__ ? \"ObservableArray@\" + getNextId() : \"ObservableArray\",\n        enhancer: IEnhancer<any>,\n        public owned_: boolean,\n        public legacyMode_: boolean\n    ) {\n        this.atom_ = new Atom(name)\n        this.enhancer_ = (newV, oldV) =>\n            enhancer(newV, oldV, __DEV__ ? name + \"[..]\" : \"ObservableArray[..]\")\n    }\n\n    dehanceValue_(value: any): any {\n        if (this.dehancer !== undefined) {\n            return this.dehancer(value)\n        }\n        return value\n    }\n\n    dehanceValues_(values: any[]): any[] {\n        if (this.dehancer !== undefined && values.length > 0) {\n            return values.map(this.dehancer) as any\n        }\n        return values\n    }\n\n    intercept_(handler: IInterceptor<IArrayWillChange<any> | IArrayWillSplice<any>>): Lambda {\n        return registerInterceptor<IArrayWillChange<any> | IArrayWillSplice<any>>(this, handler)\n    }\n\n    observe_(\n        listener: (changeData: IArrayDidChange<any>) => void,\n        fireImmediately = false\n    ): Lambda {\n        if (fireImmediately) {\n            listener(<IArraySplice<any>>{\n                observableKind: \"array\",\n                object: this.proxy_ as any,\n                debugObjectName: this.atom_.name_,\n                type: \"splice\",\n                index: 0,\n                added: this.values_.slice(),\n                addedCount: this.values_.length,\n                removed: [],\n                removedCount: 0\n            })\n        }\n        return registerListener(this, listener)\n    }\n\n    getArrayLength_(): number {\n        this.atom_.reportObserved()\n        return this.values_.length\n    }\n\n    setArrayLength_(newLength: number) {\n        if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n            die(\"Out of range: \" + newLength)\n        }\n        let currentLength = this.values_.length\n        if (newLength === currentLength) {\n            return\n        } else if (newLength > currentLength) {\n            const newItems = new Array(newLength - currentLength)\n            for (let i = 0; i < newLength - currentLength; i++) {\n                newItems[i] = undefined\n            } // No Array.fill everywhere...\n            this.spliceWithArray_(currentLength, 0, newItems)\n        } else {\n            this.spliceWithArray_(newLength, currentLength - newLength)\n        }\n    }\n\n    updateArrayLength_(oldLength: number, delta: number) {\n        if (oldLength !== this.lastKnownLength_) {\n            die(16)\n        }\n        this.lastKnownLength_ += delta\n        if (this.legacyMode_ && delta > 0) {\n            reserveArrayBuffer(oldLength + delta + 1)\n        }\n    }\n\n    spliceWithArray_(index: number, deleteCount?: number, newItems?: any[]): any[] {\n        checkIfStateModificationsAreAllowed(this.atom_)\n        const length = this.values_.length\n\n        if (index === undefined) {\n            index = 0\n        } else if (index > length) {\n            index = length\n        } else if (index < 0) {\n            index = Math.max(0, length + index)\n        }\n\n        if (arguments.length === 1) {\n            deleteCount = length - index\n        } else if (deleteCount === undefined || deleteCount === null) {\n            deleteCount = 0\n        } else {\n            deleteCount = Math.max(0, Math.min(deleteCount, length - index))\n        }\n\n        if (newItems === undefined) {\n            newItems = EMPTY_ARRAY\n        }\n\n        if (hasInterceptors(this)) {\n            const change = interceptChange<IArrayWillSplice<any>>(this as any, {\n                object: this.proxy_ as any,\n                type: SPLICE,\n                index,\n                removedCount: deleteCount,\n                added: newItems\n            })\n            if (!change) {\n                return EMPTY_ARRAY\n            }\n            deleteCount = change.removedCount\n            newItems = change.added\n        }\n\n        newItems =\n            newItems.length === 0 ? newItems : newItems.map(v => this.enhancer_(v, undefined))\n        if (this.legacyMode_ || __DEV__) {\n            const lengthDelta = newItems.length - deleteCount\n            this.updateArrayLength_(length, lengthDelta) // checks if internal array wasn't modified\n        }\n        const res = this.spliceItemsIntoValues_(index, deleteCount, newItems)\n\n        if (deleteCount !== 0 || newItems.length !== 0) {\n            this.notifyArraySplice_(index, newItems, res)\n        }\n        return this.dehanceValues_(res)\n    }\n\n    spliceItemsIntoValues_(index: number, deleteCount: number, newItems: any[]): any[] {\n        if (newItems.length < MAX_SPLICE_SIZE) {\n            return this.values_.splice(index, deleteCount, ...newItems)\n        } else {\n            // The items removed by the splice\n            const res = this.values_.slice(index, index + deleteCount)\n            // The items that that should remain at the end of the array\n            let oldItems = this.values_.slice(index + deleteCount)\n            // New length is the previous length + addition count - deletion count\n            this.values_.length += newItems.length - deleteCount\n            for (let i = 0; i < newItems.length; i++) {\n                this.values_[index + i] = newItems[i]\n            }\n            for (let i = 0; i < oldItems.length; i++) {\n                this.values_[index + newItems.length + i] = oldItems[i]\n            }\n            return res\n        }\n    }\n\n    notifyArrayChildUpdate_(index: number, newValue: any, oldValue: any) {\n        const notifySpy = !this.owned_ && isSpyEnabled()\n        const notify = hasListeners(this)\n        const change: IArrayDidChange | null =\n            notify || notifySpy\n                ? ({\n                      observableKind: \"array\",\n                      object: this.proxy_,\n                      type: UPDATE,\n                      debugObjectName: this.atom_.name_,\n                      index,\n                      newValue,\n                      oldValue\n                  } as const)\n                : null\n\n        // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n        // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n        if (__DEV__ && notifySpy) {\n            spyReportStart(change!)\n        }\n        this.atom_.reportChanged()\n        if (notify) {\n            notifyListeners(this, change)\n        }\n        if (__DEV__ && notifySpy) {\n            spyReportEnd()\n        }\n    }\n\n    notifyArraySplice_(index: number, added: any[], removed: any[]) {\n        const notifySpy = !this.owned_ && isSpyEnabled()\n        const notify = hasListeners(this)\n        const change: IArraySplice | null =\n            notify || notifySpy\n                ? ({\n                      observableKind: \"array\",\n                      object: this.proxy_,\n                      debugObjectName: this.atom_.name_,\n                      type: SPLICE,\n                      index,\n                      removed,\n                      added,\n                      removedCount: removed.length,\n                      addedCount: added.length\n                  } as const)\n                : null\n\n        if (__DEV__ && notifySpy) {\n            spyReportStart(change!)\n        }\n        this.atom_.reportChanged()\n        // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n        if (notify) {\n            notifyListeners(this, change)\n        }\n        if (__DEV__ && notifySpy) {\n            spyReportEnd()\n        }\n    }\n\n    get_(index: number): any | undefined {\n        if (index < this.values_.length) {\n            this.atom_.reportObserved()\n            return this.dehanceValue_(this.values_[index])\n        }\n        console.warn(\n            __DEV__\n                ? `[mobx] Out of bounds read: ${index}`\n                : `[mobx.array] Attempt to read an array index (${index}) that is out of bounds (${this.values_.length}). Please check length first. Out of bound indices will not be tracked by MobX`\n        )\n    }\n\n    set_(index: number, newValue: any) {\n        const values = this.values_\n        if (index < values.length) {\n            // update at index in range\n            checkIfStateModificationsAreAllowed(this.atom_)\n            const oldValue = values[index]\n            if (hasInterceptors(this)) {\n                const change = interceptChange<IArrayWillChange<any>>(this as any, {\n                    type: UPDATE,\n                    object: this.proxy_ as any, // since \"this\" is the real array we need to pass its proxy\n                    index,\n                    newValue\n                })\n                if (!change) {\n                    return\n                }\n                newValue = change.newValue\n            }\n            newValue = this.enhancer_(newValue, oldValue)\n            const changed = newValue !== oldValue\n            if (changed) {\n                values[index] = newValue\n                this.notifyArrayChildUpdate_(index, newValue, oldValue)\n            }\n        } else if (index === values.length) {\n            // add a new item\n            this.spliceWithArray_(index, 0, [newValue])\n        } else {\n            // out of bounds\n            die(17, index, values.length)\n        }\n    }\n}\n\nexport function createObservableArray<T>(\n    initialValues: T[] | undefined,\n    enhancer: IEnhancer<T>,\n    name = __DEV__ ? \"ObservableArray@\" + getNextId() : \"ObservableArray\",\n    owned = false\n): IObservableArray<T> {\n    assertProxies()\n    const adm = new ObservableArrayAdministration(name, enhancer, owned, false)\n    addHiddenFinalProp(adm.values_, $mobx, adm)\n    const proxy = new Proxy(adm.values_, arrayTraps) as any\n    adm.proxy_ = proxy\n    if (initialValues && initialValues.length) {\n        const prev = allowStateChangesStart(true)\n        adm.spliceWithArray_(0, 0, initialValues)\n        allowStateChangesEnd(prev)\n    }\n    return proxy\n}\n\n// eslint-disable-next-line\nexport var arrayExtensions = {\n    clear(): any[] {\n        return this.splice(0)\n    },\n\n    replace(newItems: any[]) {\n        const adm: ObservableArrayAdministration = this[$mobx]\n        return adm.spliceWithArray_(0, adm.values_.length, newItems)\n    },\n\n    // Used by JSON.stringify\n    toJSON(): any[] {\n        return this.slice()\n    },\n\n    /*\n     * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n     * since these functions alter the inner structure of the array, the have side effects.\n     * Because the have side effects, they should not be used in computed function,\n     * and for that reason the do not call dependencyState.notifyObserved\n     */\n    splice(index: number, deleteCount?: number, ...newItems: any[]): any[] {\n        const adm: ObservableArrayAdministration = this[$mobx]\n        switch (arguments.length) {\n            case 0:\n                return []\n            case 1:\n                return adm.spliceWithArray_(index)\n            case 2:\n                return adm.spliceWithArray_(index, deleteCount)\n        }\n        return adm.spliceWithArray_(index, deleteCount, newItems)\n    },\n\n    spliceWithArray(index: number, deleteCount?: number, newItems?: any[]): any[] {\n        return (this[$mobx] as ObservableArrayAdministration).spliceWithArray_(\n            index,\n            deleteCount,\n            newItems\n        )\n    },\n\n    push(...items: any[]): number {\n        const adm: ObservableArrayAdministration = this[$mobx]\n        adm.spliceWithArray_(adm.values_.length, 0, items)\n        return adm.values_.length\n    },\n\n    pop() {\n        return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0]\n    },\n\n    shift() {\n        return this.splice(0, 1)[0]\n    },\n\n    unshift(...items: any[]): number {\n        const adm: ObservableArrayAdministration = this[$mobx]\n        adm.spliceWithArray_(0, 0, items)\n        return adm.values_.length\n    },\n\n    reverse(): any[] {\n        // reverse by default mutates in place before returning the result\n        // which makes it both a 'derivation' and a 'mutation'.\n        if (globalState.trackingDerivation) {\n            die(37, \"reverse\")\n        }\n        this.replace(this.slice().reverse())\n        return this\n    },\n\n    sort(): any[] {\n        // sort by default mutates in place before returning the result\n        // which goes against all good practices. Let's not change the array in place!\n        if (globalState.trackingDerivation) {\n            die(37, \"sort\")\n        }\n        const copy = this.slice()\n        copy.sort.apply(copy, arguments)\n        this.replace(copy)\n        return this\n    },\n\n    remove(value: any): boolean {\n        const adm: ObservableArrayAdministration = this[$mobx]\n        const idx = adm.dehanceValues_(adm.values_).indexOf(value)\n        if (idx > -1) {\n            this.splice(idx, 1)\n            return true\n        }\n        return false\n    }\n}\n\n/**\n * Wrap function from prototype\n * Without this, everything works as well, but this works\n * faster as everything works on unproxied values\n */\naddArrayExtension(\"concat\", simpleFunc)\naddArrayExtension(\"flat\", simpleFunc)\naddArrayExtension(\"includes\", simpleFunc)\naddArrayExtension(\"indexOf\", simpleFunc)\naddArrayExtension(\"join\", simpleFunc)\naddArrayExtension(\"lastIndexOf\", simpleFunc)\naddArrayExtension(\"slice\", simpleFunc)\naddArrayExtension(\"toString\", simpleFunc)\naddArrayExtension(\"toLocaleString\", simpleFunc)\n// map\naddArrayExtension(\"every\", mapLikeFunc)\naddArrayExtension(\"filter\", mapLikeFunc)\naddArrayExtension(\"find\", mapLikeFunc)\naddArrayExtension(\"findIndex\", mapLikeFunc)\naddArrayExtension(\"flatMap\", mapLikeFunc)\naddArrayExtension(\"forEach\", mapLikeFunc)\naddArrayExtension(\"map\", mapLikeFunc)\naddArrayExtension(\"some\", mapLikeFunc)\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc)\naddArrayExtension(\"reduceRight\", reduceLikeFunc)\n\nfunction addArrayExtension(funcName, funcFactory) {\n    if (typeof Array.prototype[funcName] === \"function\") {\n        arrayExtensions[funcName] = funcFactory(funcName)\n    }\n}\n\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n    return function () {\n        const adm: ObservableArrayAdministration = this[$mobx]\n        adm.atom_.reportObserved()\n        const dehancedValues = adm.dehanceValues_(adm.values_)\n        return dehancedValues[funcName].apply(dehancedValues, arguments)\n    }\n}\n\n// Make sure callbacks recieve correct array arg #2326\nfunction mapLikeFunc(funcName) {\n    return function (callback, thisArg) {\n        const adm: ObservableArrayAdministration = this[$mobx]\n        adm.atom_.reportObserved()\n        const dehancedValues = adm.dehanceValues_(adm.values_)\n        return dehancedValues[funcName]((element, index) => {\n            return callback.call(thisArg, element, index, this)\n        })\n    }\n}\n\n// Make sure callbacks recieve correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n    return function () {\n        const adm: ObservableArrayAdministration = this[$mobx]\n        adm.atom_.reportObserved()\n        const dehancedValues = adm.dehanceValues_(adm.values_)\n        // #2432 - reduce behavior depends on arguments.length\n        const callback = arguments[0]\n        arguments[0] = (accumulator, currentValue, index) => {\n            return callback(accumulator, currentValue, index, this)\n        }\n        return dehancedValues[funcName].apply(dehancedValues, arguments)\n    }\n}\n\nconst isObservableArrayAdministration = createInstanceofPredicate(\n    \"ObservableArrayAdministration\",\n    ObservableArrayAdministration\n)\n\nexport function isObservableArray(thing): thing is IObservableArray<any> {\n    return isObject(thing) && isObservableArrayAdministration(thing[$mobx])\n}\n","import {\n    $mobx,\n    IEnhancer,\n    IInterceptable,\n    IInterceptor,\n    IListenable,\n    Lambda,\n    ObservableValue,\n    checkIfStateModificationsAreAllowed,\n    createAtom,\n    createInstanceofPredicate,\n    deepEnhancer,\n    getNextId,\n    getPlainObjectKeys,\n    hasInterceptors,\n    hasListeners,\n    interceptChange,\n    isES6Map,\n    isPlainObject,\n    isSpyEnabled,\n    makeIterable,\n    notifyListeners,\n    referenceEnhancer,\n    registerInterceptor,\n    registerListener,\n    spyReportEnd,\n    spyReportStart,\n    stringifyKey,\n    transaction,\n    untracked,\n    onBecomeUnobserved,\n    globalState,\n    die,\n    isFunction,\n    UPDATE,\n    IAtom,\n    PureSpyEvent,\n    allowStateChanges\n} from \"../internal\"\n\nexport interface IKeyValueMap<V = any> {\n    [key: string]: V\n}\n\nexport type IMapEntry<K = any, V = any> = [K, V]\nexport type IReadonlyMapEntry<K = any, V = any> = readonly [K, V]\nexport type IMapEntries<K = any, V = any> = IMapEntry<K, V>[]\nexport type IReadonlyMapEntries<K = any, V = any> = IReadonlyMapEntry<K, V>[]\n\nexport type IMapDidChange<K = any, V = any> = { observableKind: \"map\"; debugObjectName: string } & (\n    | {\n          object: ObservableMap<K, V>\n          name: K // actual the key or index, but this is based on the ancient .observe proposal for consistency\n          type: \"update\"\n          newValue: V\n          oldValue: V\n      }\n    | {\n          object: ObservableMap<K, V>\n          name: K\n          type: \"add\"\n          newValue: V\n      }\n    | {\n          object: ObservableMap<K, V>\n          name: K\n          type: \"delete\"\n          oldValue: V\n      }\n)\n\nexport interface IMapWillChange<K = any, V = any> {\n    object: ObservableMap<K, V>\n    type: \"update\" | \"add\" | \"delete\"\n    name: K\n    newValue?: V\n}\n\nconst ObservableMapMarker = {}\n\nexport const ADD = \"add\"\nexport const DELETE = \"delete\"\n\nexport type IObservableMapInitialValues<K = any, V = any> =\n    | IMapEntries<K, V>\n    | IReadonlyMapEntries<K, V>\n    | IKeyValueMap<V>\n    | Map<K, V>\n\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\nexport class ObservableMap<K = any, V = any>\n    implements Map<K, V>, IInterceptable<IMapWillChange<K, V>>, IListenable {\n    [$mobx] = ObservableMapMarker\n    data_: Map<K, ObservableValue<V>>\n    hasMap_: Map<K, ObservableValue<boolean>> // hasMap, not hashMap >-).\n    keysAtom_: IAtom\n    interceptors_\n    changeListeners_\n    dehancer: any\n\n    constructor(\n        initialData?: IObservableMapInitialValues<K, V>,\n        public enhancer_: IEnhancer<V> = deepEnhancer,\n        public name_ = __DEV__ ? \"ObservableMap@\" + getNextId() : \"ObservableMap\"\n    ) {\n        if (!isFunction(Map)) {\n            die(18)\n        }\n        this.keysAtom_ = createAtom(__DEV__ ? `${this.name_}.keys()` : \"ObservableMap.keys()\")\n        this.data_ = new Map()\n        this.hasMap_ = new Map()\n        allowStateChanges(true, () => {\n            this.merge(initialData)\n        })\n    }\n\n    private has_(key: K): boolean {\n        return this.data_.has(key)\n    }\n\n    has(key: K): boolean {\n        if (!globalState.trackingDerivation) {\n            return this.has_(key)\n        }\n\n        let entry = this.hasMap_.get(key)\n        if (!entry) {\n            const newEntry = (entry = new ObservableValue(\n                this.has_(key),\n                referenceEnhancer,\n                __DEV__ ? `${this.name_}.${stringifyKey(key)}?` : \"ObservableMap.key?\",\n                false\n            ))\n            this.hasMap_.set(key, newEntry)\n            onBecomeUnobserved(newEntry, () => this.hasMap_.delete(key))\n        }\n\n        return entry.get()\n    }\n\n    set(key: K, value: V) {\n        const hasKey = this.has_(key)\n        if (hasInterceptors(this)) {\n            const change = interceptChange<IMapWillChange<K, V>>(this, {\n                type: hasKey ? UPDATE : ADD,\n                object: this,\n                newValue: value,\n                name: key\n            })\n            if (!change) {\n                return this\n            }\n            value = change.newValue!\n        }\n        if (hasKey) {\n            this.updateValue_(key, value)\n        } else {\n            this.addValue_(key, value)\n        }\n        return this\n    }\n\n    delete(key: K): boolean {\n        checkIfStateModificationsAreAllowed(this.keysAtom_)\n        if (hasInterceptors(this)) {\n            const change = interceptChange<IMapWillChange<K, V>>(this, {\n                type: DELETE,\n                object: this,\n                name: key\n            })\n            if (!change) {\n                return false\n            }\n        }\n        if (this.has_(key)) {\n            const notifySpy = isSpyEnabled()\n            const notify = hasListeners(this)\n            const change: IMapDidChange<K, V> | null =\n                notify || notifySpy\n                    ? {\n                          observableKind: \"map\",\n                          debugObjectName: this.name_,\n                          type: DELETE,\n                          object: this,\n                          oldValue: (<any>this.data_.get(key)).value_,\n                          name: key\n                      }\n                    : null\n\n            if (__DEV__ && notifySpy) {\n                spyReportStart(change! as PureSpyEvent)\n            } // TODO fix type\n            transaction(() => {\n                this.keysAtom_.reportChanged()\n                this.hasMap_.get(key)?.setNewValue_(false)\n                const observable = this.data_.get(key)!\n                observable.setNewValue_(undefined as any)\n                this.data_.delete(key)\n            })\n            if (notify) {\n                notifyListeners(this, change)\n            }\n            if (__DEV__ && notifySpy) {\n                spyReportEnd()\n            }\n            return true\n        }\n        return false\n    }\n\n    private updateValue_(key: K, newValue: V | undefined) {\n        const observable = this.data_.get(key)!\n        newValue = (observable as any).prepareNewValue_(newValue) as V\n        if (newValue !== globalState.UNCHANGED) {\n            const notifySpy = isSpyEnabled()\n            const notify = hasListeners(this)\n            const change: IMapDidChange<K, V> | null =\n                notify || notifySpy\n                    ? {\n                          observableKind: \"map\",\n                          debugObjectName: this.name_,\n                          type: UPDATE,\n                          object: this,\n                          oldValue: (observable as any).value_,\n                          name: key,\n                          newValue\n                      }\n                    : null\n            if (__DEV__ && notifySpy) {\n                spyReportStart(change! as PureSpyEvent)\n            } // TODO fix type\n            observable.setNewValue_(newValue as V)\n            if (notify) {\n                notifyListeners(this, change)\n            }\n            if (__DEV__ && notifySpy) {\n                spyReportEnd()\n            }\n        }\n    }\n\n    private addValue_(key: K, newValue: V) {\n        checkIfStateModificationsAreAllowed(this.keysAtom_)\n        transaction(() => {\n            const observable = new ObservableValue(\n                newValue,\n                this.enhancer_,\n                __DEV__ ? `${this.name_}.${stringifyKey(key)}` : \"ObservableMap.key\",\n                false\n            )\n            this.data_.set(key, observable)\n            newValue = (observable as any).value_ // value might have been changed\n            this.hasMap_.get(key)?.setNewValue_(true)\n            this.keysAtom_.reportChanged()\n        })\n        const notifySpy = isSpyEnabled()\n        const notify = hasListeners(this)\n        const change: IMapDidChange<K, V> | null =\n            notify || notifySpy\n                ? {\n                      observableKind: \"map\",\n                      debugObjectName: this.name_,\n                      type: ADD,\n                      object: this,\n                      name: key,\n                      newValue\n                  }\n                : null\n        if (__DEV__ && notifySpy) {\n            spyReportStart(change! as PureSpyEvent)\n        } // TODO fix type\n        if (notify) {\n            notifyListeners(this, change)\n        }\n        if (__DEV__ && notifySpy) {\n            spyReportEnd()\n        }\n    }\n\n    get(key: K): V | undefined {\n        if (this.has(key)) {\n            return this.dehanceValue_(this.data_.get(key)!.get())\n        }\n        return this.dehanceValue_(undefined)\n    }\n\n    private dehanceValue_<X extends V | undefined>(value: X): X {\n        if (this.dehancer !== undefined) {\n            return this.dehancer(value)\n        }\n        return value\n    }\n\n    keys(): IterableIterator<K> {\n        this.keysAtom_.reportObserved()\n        return this.data_.keys()\n    }\n\n    values(): IterableIterator<V> {\n        const self = this\n        const keys = this.keys()\n        return makeIterable({\n            next() {\n                const { done, value } = keys.next()\n                return {\n                    done,\n                    value: done ? (undefined as any) : self.get(value)\n                }\n            }\n        })\n    }\n\n    entries(): IterableIterator<IMapEntry<K, V>> {\n        const self = this\n        const keys = this.keys()\n        return makeIterable({\n            next() {\n                const { done, value } = keys.next()\n                return {\n                    done,\n                    value: done ? (undefined as any) : ([value, self.get(value)!] as [K, V])\n                }\n            }\n        })\n    }\n\n    [Symbol.iterator]() {\n        return this.entries()\n    }\n\n    forEach(callback: (value: V, key: K, object: Map<K, V>) => void, thisArg?) {\n        for (const [key, value] of this) {\n            callback.call(thisArg, value, key, this)\n        }\n    }\n\n    /** Merge another object into this object, returns this. */\n    merge(other?: IObservableMapInitialValues<K, V>): ObservableMap<K, V> {\n        if (isObservableMap(other)) {\n            other = new Map(other)\n        }\n        transaction(() => {\n            if (isPlainObject(other)) {\n                getPlainObjectKeys(other).forEach((key: any) =>\n                    this.set(key as K, (other as IKeyValueMap)[key])\n                )\n            } else if (Array.isArray(other)) {\n                other.forEach(([key, value]) => this.set(key, value))\n            } else if (isES6Map(other)) {\n                if (other.constructor !== Map) {\n                    die(19, other)\n                }\n                other.forEach((value, key) => this.set(key, value))\n            } else if (other !== null && other !== undefined) {\n                die(20, other)\n            }\n        })\n        return this\n    }\n\n    clear() {\n        transaction(() => {\n            untracked(() => {\n                for (const key of this.keys()) {\n                    this.delete(key)\n                }\n            })\n        })\n    }\n\n    replace(values: IObservableMapInitialValues<K, V>): ObservableMap<K, V> {\n        // Implementation requirements:\n        // - respect ordering of replacement map\n        // - allow interceptors to run and potentially prevent individual operations\n        // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n        // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n        // - note that result map may differ from replacement map due to the interceptors\n        transaction(() => {\n            // Convert to map so we can do quick key lookups\n            const replacementMap = convertToMap(values)\n            const orderedData = new Map()\n            // Used for optimization\n            let keysReportChangedCalled = false\n            // Delete keys that don't exist in replacement map\n            // if the key deletion is prevented by interceptor\n            // add entry at the beginning of the result map\n            for (const key of this.data_.keys()) {\n                // Concurrently iterating/deleting keys\n                // iterator should handle this correctly\n                if (!replacementMap.has(key)) {\n                    const deleted = this.delete(key)\n                    // Was the key removed?\n                    if (deleted) {\n                        // _keysAtom.reportChanged() was already called\n                        keysReportChangedCalled = true\n                    } else {\n                        // Delete prevented by interceptor\n                        const value = this.data_.get(key)\n                        orderedData.set(key, value)\n                    }\n                }\n            }\n            // Merge entries\n            for (const [key, value] of replacementMap.entries()) {\n                // We will want to know whether a new key is added\n                const keyExisted = this.data_.has(key)\n                // Add or update value\n                this.set(key, value)\n                // The addition could have been prevent by interceptor\n                if (this.data_.has(key)) {\n                    // The update could have been prevented by interceptor\n                    // and also we want to preserve existing values\n                    // so use value from _data map (instead of replacement map)\n                    const value = this.data_.get(key)\n                    orderedData.set(key, value)\n                    // Was a new key added?\n                    if (!keyExisted) {\n                        // _keysAtom.reportChanged() was already called\n                        keysReportChangedCalled = true\n                    }\n                }\n            }\n            // Check for possible key order change\n            if (!keysReportChangedCalled) {\n                if (this.data_.size !== orderedData.size) {\n                    // If size differs, keys are definitely modified\n                    this.keysAtom_.reportChanged()\n                } else {\n                    const iter1 = this.data_.keys()\n                    const iter2 = orderedData.keys()\n                    let next1 = iter1.next()\n                    let next2 = iter2.next()\n                    while (!next1.done) {\n                        if (next1.value !== next2.value) {\n                            this.keysAtom_.reportChanged()\n                            break\n                        }\n                        next1 = iter1.next()\n                        next2 = iter2.next()\n                    }\n                }\n            }\n            // Use correctly ordered map\n            this.data_ = orderedData\n        })\n        return this\n    }\n\n    get size(): number {\n        this.keysAtom_.reportObserved()\n        return this.data_.size\n    }\n\n    toString(): string {\n        return \"[object ObservableMap]\"\n    }\n\n    toJSON(): [K, V][] {\n        return Array.from(this)\n    }\n\n    get [Symbol.toStringTag]() {\n        return \"Map\"\n    }\n\n    /**\n     * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n     * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n     * for callback details\n     */\n    observe_(listener: (changes: IMapDidChange<K, V>) => void, fireImmediately?: boolean): Lambda {\n        if (__DEV__ && fireImmediately === true) {\n            die(\"`observe` doesn't support fireImmediately=true in combination with maps.\")\n        }\n        return registerListener(this, listener)\n    }\n\n    intercept_(handler: IInterceptor<IMapWillChange<K, V>>): Lambda {\n        return registerInterceptor(this, handler)\n    }\n}\n\n// eslint-disable-next-line\nexport var isObservableMap = createInstanceofPredicate(\"ObservableMap\", ObservableMap) as (\n    thing: any\n) => thing is ObservableMap<any, any>\n\nfunction convertToMap(dataStructure: any): Map<any, any> {\n    if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n        return dataStructure\n    } else if (Array.isArray(dataStructure)) {\n        return new Map(dataStructure)\n    } else if (isPlainObject(dataStructure)) {\n        const map = new Map()\n        for (const key in dataStructure) {\n            map.set(key, dataStructure[key])\n        }\n        return map\n    } else {\n        return die(21, dataStructure)\n    }\n}\n","import {\n    $mobx,\n    createAtom,\n    deepEnhancer,\n    getNextId,\n    IEnhancer,\n    isSpyEnabled,\n    hasListeners,\n    IListenable,\n    registerListener,\n    Lambda,\n    spyReportStart,\n    notifyListeners,\n    spyReportEnd,\n    createInstanceofPredicate,\n    hasInterceptors,\n    interceptChange,\n    IInterceptable,\n    IInterceptor,\n    registerInterceptor,\n    checkIfStateModificationsAreAllowed,\n    untracked,\n    makeIterable,\n    transaction,\n    isES6Set,\n    IAtom,\n    DELETE,\n    ADD,\n    die,\n    isFunction\n} from \"../internal\"\n\nconst ObservableSetMarker = {}\n\nexport type IObservableSetInitialValues<T> = Set<T> | readonly T[]\n\nexport type ISetDidChange<T = any> =\n    | {\n          object: ObservableSet<T>\n          observableKind: \"set\"\n          debugObjectName: string\n          type: \"add\"\n          newValue: T\n      }\n    | {\n          object: ObservableSet<T>\n          observableKind: \"set\"\n          debugObjectName: string\n          type: \"delete\"\n          oldValue: T\n      }\n\nexport type ISetWillChange<T = any> =\n    | {\n          type: \"delete\"\n          object: ObservableSet<T>\n          oldValue: T\n      }\n    | {\n          type: \"add\"\n          object: ObservableSet<T>\n          newValue: T\n      }\n\nexport class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillChange>, IListenable {\n    [$mobx] = ObservableSetMarker\n    private data_: Set<any> = new Set()\n    private atom_: IAtom\n    changeListeners_\n    interceptors_\n    dehancer: any\n    enhancer_: (newV: any, oldV: any | undefined) => any\n\n    constructor(\n        initialData?: IObservableSetInitialValues<T>,\n        enhancer: IEnhancer<T> = deepEnhancer,\n        public name_ = __DEV__ ? \"ObservableSet@\" + getNextId() : \"ObservableSet\"\n    ) {\n        if (!isFunction(Set)) {\n            die(22)\n        }\n        this.atom_ = createAtom(this.name_)\n        this.enhancer_ = (newV, oldV) => enhancer(newV, oldV, name_)\n        if (initialData) {\n            this.replace(initialData)\n        }\n    }\n\n    private dehanceValue_<X extends T | undefined>(value: X): X {\n        if (this.dehancer !== undefined) {\n            return this.dehancer(value)\n        }\n        return value\n    }\n\n    clear() {\n        transaction(() => {\n            untracked(() => {\n                for (const value of this.data_.values()) {\n                    this.delete(value)\n                }\n            })\n        })\n    }\n\n    forEach(callbackFn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any) {\n        for (const value of this) {\n            callbackFn.call(thisArg, value, value, this)\n        }\n    }\n\n    get size() {\n        this.atom_.reportObserved()\n        return this.data_.size\n    }\n\n    add(value: T) {\n        checkIfStateModificationsAreAllowed(this.atom_)\n        if (hasInterceptors(this)) {\n            const change = interceptChange<ISetWillChange<T>>(this, {\n                type: ADD,\n                object: this,\n                newValue: value\n            })\n            if (!change) {\n                return this\n            }\n            // ideally, value = change.value would be done here, so that values can be\n            // changed by interceptor. Same applies for other Set and Map api's.\n        }\n        if (!this.has(value)) {\n            transaction(() => {\n                this.data_.add(this.enhancer_(value, undefined))\n                this.atom_.reportChanged()\n            })\n            const notifySpy = __DEV__ && isSpyEnabled()\n            const notify = hasListeners(this)\n            const change =\n                notify || notifySpy\n                    ? <ISetDidChange<T>>{\n                          observableKind: \"set\",\n                          debugObjectName: this.name_,\n                          type: ADD,\n                          object: this,\n                          newValue: value\n                      }\n                    : null\n            if (notifySpy && __DEV__) {\n                spyReportStart(change!)\n            }\n            if (notify) {\n                notifyListeners(this, change)\n            }\n            if (notifySpy && __DEV__) {\n                spyReportEnd()\n            }\n        }\n\n        return this\n    }\n\n    delete(value: T) {\n        if (hasInterceptors(this)) {\n            const change = interceptChange<ISetWillChange<T>>(this, {\n                type: DELETE,\n                object: this,\n                oldValue: value\n            })\n            if (!change) {\n                return false\n            }\n        }\n        if (this.has(value)) {\n            const notifySpy = __DEV__ && isSpyEnabled()\n            const notify = hasListeners(this)\n            const change =\n                notify || notifySpy\n                    ? <ISetDidChange<T>>{\n                          observableKind: \"set\",\n                          debugObjectName: this.name_,\n                          type: DELETE,\n                          object: this,\n                          oldValue: value\n                      }\n                    : null\n\n            if (notifySpy && __DEV__) {\n                spyReportStart(change!)\n            }\n            transaction(() => {\n                this.atom_.reportChanged()\n                this.data_.delete(value)\n            })\n            if (notify) {\n                notifyListeners(this, change)\n            }\n            if (notifySpy && __DEV__) {\n                spyReportEnd()\n            }\n            return true\n        }\n        return false\n    }\n\n    has(value: T) {\n        this.atom_.reportObserved()\n        return this.data_.has(this.dehanceValue_(value))\n    }\n\n    entries() {\n        let nextIndex = 0\n        const keys = Array.from(this.keys())\n        const values = Array.from(this.values())\n        return makeIterable<[T, T]>({\n            next() {\n                const index = nextIndex\n                nextIndex += 1\n                return index < values.length\n                    ? { value: [keys[index], values[index]], done: false }\n                    : { done: true }\n            }\n        } as any)\n    }\n\n    keys(): IterableIterator<T> {\n        return this.values()\n    }\n\n    values(): IterableIterator<T> {\n        this.atom_.reportObserved()\n        const self = this\n        let nextIndex = 0\n        const observableValues = Array.from(this.data_.values())\n        return makeIterable<T>({\n            next() {\n                return nextIndex < observableValues.length\n                    ? { value: self.dehanceValue_(observableValues[nextIndex++]), done: false }\n                    : { done: true }\n            }\n        } as any)\n    }\n\n    replace(other: ObservableSet<T> | IObservableSetInitialValues<T>): ObservableSet<T> {\n        if (isObservableSet(other)) {\n            other = new Set(other)\n        }\n\n        transaction(() => {\n            if (Array.isArray(other)) {\n                this.clear()\n                other.forEach(value => this.add(value))\n            } else if (isES6Set(other)) {\n                this.clear()\n                other.forEach(value => this.add(value))\n            } else if (other !== null && other !== undefined) {\n                die(\"Cannot initialize set from \" + other)\n            }\n        })\n\n        return this\n    }\n    observe_(listener: (changes: ISetDidChange<T>) => void, fireImmediately?: boolean): Lambda {\n        // ... 'fireImmediately' could also be true?\n        if (__DEV__ && fireImmediately === true) {\n            die(\"`observe` doesn't support fireImmediately=true in combination with sets.\")\n        }\n        return registerListener(this, listener)\n    }\n\n    intercept_(handler: IInterceptor<ISetWillChange<T>>): Lambda {\n        return registerInterceptor(this, handler)\n    }\n\n    toJSON(): T[] {\n        return Array.from(this)\n    }\n\n    toString(): string {\n        return \"[object ObservableSet]\"\n    }\n\n    [Symbol.iterator]() {\n        return this.values()\n    }\n\n    get [Symbol.toStringTag]() {\n        return \"Set\"\n    }\n}\n\n// eslint-disable-next-line\nexport var isObservableSet = createInstanceofPredicate(\"ObservableSet\", ObservableSet) as (\n    thing: any\n) => thing is ObservableSet<any>\n","import {\n    CreateObservableOptions,\n    getAnnotationFromOptions,\n    propagateChanged,\n    isAnnotation,\n    $mobx,\n    Atom,\n    Annotation,\n    ComputedValue,\n    IAtom,\n    IComputedValueOptions,\n    IEnhancer,\n    IInterceptable,\n    IListenable,\n    Lambda,\n    ObservableValue,\n    addHiddenProp,\n    createInstanceofPredicate,\n    endBatch,\n    getNextId,\n    hasInterceptors,\n    hasListeners,\n    interceptChange,\n    isObject,\n    isPlainObject,\n    isSpyEnabled,\n    notifyListeners,\n    referenceEnhancer,\n    registerInterceptor,\n    registerListener,\n    spyReportEnd,\n    spyReportStart,\n    startBatch,\n    stringifyKey,\n    globalState,\n    ADD,\n    UPDATE,\n    die,\n    hasProp,\n    getDescriptor,\n    storedAnnotationsSymbol,\n    ownKeys,\n    isOverride,\n    defineProperty,\n    autoAnnotation,\n    getAdministration,\n    getDebugName,\n    objectPrototype,\n    MakeResult\n} from \"../internal\"\n\nconst descriptorCache = Object.create(null)\n\nexport type IObjectDidChange<T = any> = {\n    observableKind: \"object\"\n    name: PropertyKey\n    object: T\n    debugObjectName: string\n} & (\n    | {\n          type: \"add\"\n          newValue: any\n      }\n    | {\n          type: \"update\"\n          oldValue: any\n          newValue: any\n      }\n    | {\n          type: \"remove\"\n          oldValue: any\n      }\n)\n\nexport type IObjectWillChange<T = any> =\n    | {\n          object: T\n          type: \"update\" | \"add\"\n          name: PropertyKey\n          newValue: any\n      }\n    | {\n          object: T\n          type: \"remove\"\n          name: PropertyKey\n      }\n\nconst REMOVE = \"remove\"\n\nexport class ObservableObjectAdministration\n    implements IInterceptable<IObjectWillChange>, IListenable\n{\n    keysAtom_: IAtom\n    changeListeners_\n    interceptors_\n    proxy_: any\n    isPlainObject_: boolean\n    appliedAnnotations_?: object\n    private pendingKeys_: undefined | Map<PropertyKey, ObservableValue<boolean>>\n\n    constructor(\n        public target_: any,\n        public values_ = new Map<PropertyKey, ObservableValue<any> | ComputedValue<any>>(),\n        public name_: string,\n        // Used anytime annotation is not explicitely provided\n        public defaultAnnotation_: Annotation = autoAnnotation\n    ) {\n        this.keysAtom_ = new Atom(__DEV__ ? `${this.name_}.keys` : \"ObservableObject.keys\")\n        // Optimization: we use this frequently\n        this.isPlainObject_ = isPlainObject(this.target_)\n        if (__DEV__ && !isAnnotation(this.defaultAnnotation_)) {\n            die(`defaultAnnotation must be valid annotation`)\n        }\n        if (__DEV__) {\n            // Prepare structure for tracking which fields were already annotated\n            this.appliedAnnotations_ = {}\n        }\n    }\n\n    getObservablePropValue_(key: PropertyKey): any {\n        return this.values_.get(key)!.get()\n    }\n\n    setObservablePropValue_(key: PropertyKey, newValue): boolean | null {\n        const observable = this.values_.get(key)\n        if (observable instanceof ComputedValue) {\n            observable.set(newValue)\n            return true\n        }\n\n        // intercept\n        if (hasInterceptors(this)) {\n            const change = interceptChange<IObjectWillChange>(this, {\n                type: UPDATE,\n                object: this.proxy_ || this.target_,\n                name: key,\n                newValue\n            })\n            if (!change) {\n                return null\n            }\n            newValue = (change as any).newValue\n        }\n        newValue = (observable as any).prepareNewValue_(newValue)\n\n        // notify spy & observers\n        if (newValue !== globalState.UNCHANGED) {\n            const notify = hasListeners(this)\n            const notifySpy = __DEV__ && isSpyEnabled()\n            const change: IObjectDidChange | null =\n                notify || notifySpy\n                    ? {\n                          type: UPDATE,\n                          observableKind: \"object\",\n                          debugObjectName: this.name_,\n                          object: this.proxy_ || this.target_,\n                          oldValue: (observable as any).value_,\n                          name: key,\n                          newValue\n                      }\n                    : null\n\n            if (__DEV__ && notifySpy) {\n                spyReportStart(change!)\n            }\n            ;(observable as ObservableValue<any>).setNewValue_(newValue)\n            if (notify) {\n                notifyListeners(this, change)\n            }\n            if (__DEV__ && notifySpy) {\n                spyReportEnd()\n            }\n        }\n        return true\n    }\n\n    get_(key: PropertyKey): any {\n        if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n            // Key doesn't exist yet, subscribe for it in case it's added later\n            this.has_(key)\n        }\n        return this.target_[key]\n    }\n\n    /**\n     * @param {PropertyKey} key\n     * @param {any} value\n     * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n     * @param {boolean} proxyTrap whether it's called from proxy trap\n     * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n     */\n    set_(key: PropertyKey, value: any, proxyTrap: boolean = false): boolean | null {\n        // Don't use .has(key) - we care about own\n        if (hasProp(this.target_, key)) {\n            // Existing prop\n            if (this.values_.has(key)) {\n                // Observable (can be intercepted)\n                return this.setObservablePropValue_(key, value)\n            } else if (proxyTrap) {\n                // Non-observable - proxy\n                return Reflect.set(this.target_, key, value)\n            } else {\n                // Non-observable\n                this.target_[key] = value\n                return true\n            }\n        } else {\n            // New prop\n            return this.extend_(\n                key,\n                { value, enumerable: true, writable: true, configurable: true },\n                this.defaultAnnotation_,\n                proxyTrap\n            )\n        }\n    }\n\n    // Trap for \"in\"\n    has_(key: PropertyKey): boolean {\n        if (!globalState.trackingDerivation) {\n            // Skip key subscription outside derivation\n            return key in this.target_\n        }\n        this.pendingKeys_ ||= new Map()\n        let entry = this.pendingKeys_.get(key)\n        if (!entry) {\n            entry = new ObservableValue(\n                key in this.target_,\n                referenceEnhancer,\n                __DEV__ ? `${this.name_}.${stringifyKey(key)}?` : \"ObservableObject.key?\",\n                false\n            )\n            this.pendingKeys_.set(key, entry)\n        }\n        return entry.get()\n    }\n\n    /**\n     * @param {PropertyKey} key\n     * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\n     */\n    make_(key: PropertyKey, annotation: Annotation | boolean): void {\n        if (annotation === true) {\n            annotation = this.defaultAnnotation_\n        }\n        if (annotation === false) {\n            return\n        }\n        assertAnnotable(this, annotation, key)\n        if (!(key in this.target_)) {\n            // Throw on missing key, except for decorators:\n            // Decorator annotations are collected from whole prototype chain.\n            // When called from super() some props may not exist yet.\n            // However we don't have to worry about missing prop,\n            // because the decorator must have been applied to something.\n            if (this.target_[storedAnnotationsSymbol]?.[key]) {\n                return // will be annotated by subclass constructor\n            } else {\n                die(1, annotation.annotationType_, `${this.name_}.${key.toString()}`)\n            }\n        }\n        let source = this.target_\n        while (source && source !== objectPrototype) {\n            const descriptor = getDescriptor(source, key)\n            if (descriptor) {\n                const outcome = annotation.make_(this, key, descriptor, source)\n                if (outcome === MakeResult.Cancel) {\n                    return\n                }\n                if (outcome === MakeResult.Break) {\n                    break\n                }\n            }\n            source = Object.getPrototypeOf(source)\n        }\n        recordAnnotationApplied(this, annotation, key)\n    }\n\n    /**\n     * @param {PropertyKey} key\n     * @param {PropertyDescriptor} descriptor\n     * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n     * @param {boolean} proxyTrap whether it's called from proxy trap\n     * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n     */\n    extend_(\n        key: PropertyKey,\n        descriptor: PropertyDescriptor,\n        annotation: Annotation | boolean,\n        proxyTrap: boolean = false\n    ): boolean | null {\n        if (annotation === true) {\n            annotation = this.defaultAnnotation_\n        }\n        if (annotation === false) {\n            return this.defineProperty_(key, descriptor, proxyTrap)\n        }\n        assertAnnotable(this, annotation, key)\n        const outcome = annotation.extend_(this, key, descriptor, proxyTrap)\n        if (outcome) {\n            recordAnnotationApplied(this, annotation, key)\n        }\n        return outcome\n    }\n\n    /**\n     * @param {PropertyKey} key\n     * @param {PropertyDescriptor} descriptor\n     * @param {boolean} proxyTrap whether it's called from proxy trap\n     * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n     */\n    defineProperty_(\n        key: PropertyKey,\n        descriptor: PropertyDescriptor,\n        proxyTrap: boolean = false\n    ): boolean | null {\n        try {\n            startBatch()\n\n            // Delete\n            const deleteOutcome = this.delete_(key)\n            if (!deleteOutcome) {\n                // Failure or intercepted\n                return deleteOutcome\n            }\n\n            // ADD interceptor\n            if (hasInterceptors(this)) {\n                const change = interceptChange<IObjectWillChange>(this, {\n                    object: this.proxy_ || this.target_,\n                    name: key,\n                    type: ADD,\n                    newValue: descriptor.value\n                })\n                if (!change) {\n                    return null\n                }\n                const { newValue } = change as any\n                if (descriptor.value !== newValue) {\n                    descriptor = {\n                        ...descriptor,\n                        value: newValue\n                    }\n                }\n            }\n\n            // Define\n            if (proxyTrap) {\n                if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n                    return false\n                }\n            } else {\n                defineProperty(this.target_, key, descriptor)\n            }\n\n            // Notify\n            this.notifyPropertyAddition_(key, descriptor.value)\n        } finally {\n            endBatch()\n        }\n        return true\n    }\n\n    // If original descriptor becomes relevant, move this to annotation directly\n    defineObservableProperty_(\n        key: PropertyKey,\n        value: any,\n        enhancer: IEnhancer<any>,\n        proxyTrap: boolean = false\n    ): boolean | null {\n        try {\n            startBatch()\n\n            // Delete\n            const deleteOutcome = this.delete_(key)\n            if (!deleteOutcome) {\n                // Failure or intercepted\n                return deleteOutcome\n            }\n\n            // ADD interceptor\n            if (hasInterceptors(this)) {\n                const change = interceptChange<IObjectWillChange>(this, {\n                    object: this.proxy_ || this.target_,\n                    name: key,\n                    type: ADD,\n                    newValue: value\n                })\n                if (!change) {\n                    return null\n                }\n                value = (change as any).newValue\n            }\n\n            const cachedDescriptor = getCachedObservablePropDescriptor(key)\n            const descriptor = {\n                configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n                enumerable: true,\n                get: cachedDescriptor.get,\n                set: cachedDescriptor.set\n            }\n\n            // Define\n            if (proxyTrap) {\n                if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n                    return false\n                }\n            } else {\n                defineProperty(this.target_, key, descriptor)\n            }\n\n            const observable = new ObservableValue(\n                value,\n                enhancer,\n                __DEV__ ? `${this.name_}.${key.toString()}` : \"ObservableObject.key\",\n                false\n            )\n\n            this.values_.set(key, observable)\n\n            // Notify (value possibly changed by ObservableValue)\n            this.notifyPropertyAddition_(key, observable.value_)\n        } finally {\n            endBatch()\n        }\n        return true\n    }\n\n    // If original descriptor becomes relevant, move this to annotation directly\n    defineComputedProperty_(\n        key: PropertyKey,\n        options: IComputedValueOptions<any>,\n        proxyTrap: boolean = false\n    ): boolean | null {\n        try {\n            startBatch()\n\n            // Delete\n            const deleteOutcome = this.delete_(key)\n            if (!deleteOutcome) {\n                // Failure or intercepted\n                return deleteOutcome\n            }\n\n            // ADD interceptor\n            if (hasInterceptors(this)) {\n                const change = interceptChange<IObjectWillChange>(this, {\n                    object: this.proxy_ || this.target_,\n                    name: key,\n                    type: ADD,\n                    newValue: undefined\n                })\n                if (!change) {\n                    return null\n                }\n            }\n            options.name ||= __DEV__ ? `${this.name_}.${key.toString()}` : \"ObservableObject.key\"\n            options.context = this.proxy_ || this.target_\n            const cachedDescriptor = getCachedObservablePropDescriptor(key)\n            const descriptor = {\n                configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n                enumerable: false,\n                get: cachedDescriptor.get,\n                set: cachedDescriptor.set\n            }\n\n            // Define\n            if (proxyTrap) {\n                if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n                    return false\n                }\n            } else {\n                defineProperty(this.target_, key, descriptor)\n            }\n\n            this.values_.set(key, new ComputedValue(options))\n\n            // Notify\n            this.notifyPropertyAddition_(key, undefined)\n        } finally {\n            endBatch()\n        }\n        return true\n    }\n\n    /**\n     * @param {PropertyKey} key\n     * @param {PropertyDescriptor} descriptor\n     * @param {boolean} proxyTrap whether it's called from proxy trap\n     * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n     */\n    delete_(key: PropertyKey, proxyTrap: boolean = false): boolean | null {\n        // No such prop\n        if (!hasProp(this.target_, key)) {\n            return true\n        }\n\n        // Intercept\n        if (hasInterceptors(this)) {\n            const change = interceptChange<IObjectWillChange>(this, {\n                object: this.proxy_ || this.target_,\n                name: key,\n                type: REMOVE\n            })\n            // Cancelled\n            if (!change) {\n                return null\n            }\n        }\n\n        // Delete\n        try {\n            startBatch()\n            const notify = hasListeners(this)\n            const notifySpy = __DEV__ && isSpyEnabled()\n            const observable = this.values_.get(key)\n            // Value needed for spies/listeners\n            let value = undefined\n            // Optimization: don't pull the value unless we will need it\n            if (!observable && (notify || notifySpy)) {\n                value = getDescriptor(this.target_, key)?.value\n            }\n            // delete prop (do first, may fail)\n            if (proxyTrap) {\n                if (!Reflect.deleteProperty(this.target_, key)) {\n                    return false\n                }\n            } else {\n                delete this.target_[key]\n            }\n            // Allow re-annotating this field\n            if (__DEV__) {\n                delete this.appliedAnnotations_![key]\n            }\n            // Clear observable\n            if (observable) {\n                this.values_.delete(key)\n                // for computed, value is undefined\n                if (observable instanceof ObservableValue) {\n                    value = observable.value_\n                }\n                // Notify: autorun(() => obj[key]), see #1796\n                propagateChanged(observable)\n            }\n            // Notify \"keys/entries/values\" observers\n            this.keysAtom_.reportChanged()\n\n            // Notify \"has\" observers\n            // \"in\" as it may still exist in proto\n            this.pendingKeys_?.get(key)?.set(key in this.target_)\n\n            // Notify spies/listeners\n            if (notify || notifySpy) {\n                const change: IObjectDidChange = {\n                    type: REMOVE,\n                    observableKind: \"object\",\n                    object: this.proxy_ || this.target_,\n                    debugObjectName: this.name_,\n                    oldValue: value,\n                    name: key\n                }\n                if (__DEV__ && notifySpy) {\n                    spyReportStart(change!)\n                }\n                if (notify) {\n                    notifyListeners(this, change)\n                }\n                if (__DEV__ && notifySpy) {\n                    spyReportEnd()\n                }\n            }\n        } finally {\n            endBatch()\n        }\n        return true\n    }\n\n    /**\n     * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n     * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n     * for callback details\n     */\n    observe_(callback: (changes: IObjectDidChange) => void, fireImmediately?: boolean): Lambda {\n        if (__DEV__ && fireImmediately === true) {\n            die(\"`observe` doesn't support the fire immediately property for observable objects.\")\n        }\n        return registerListener(this, callback)\n    }\n\n    intercept_(handler): Lambda {\n        return registerInterceptor(this, handler)\n    }\n\n    notifyPropertyAddition_(key: PropertyKey, value: any) {\n        const notify = hasListeners(this)\n        const notifySpy = __DEV__ && isSpyEnabled()\n        if (notify || notifySpy) {\n            const change: IObjectDidChange | null =\n                notify || notifySpy\n                    ? ({\n                          type: ADD,\n                          observableKind: \"object\",\n                          debugObjectName: this.name_,\n                          object: this.proxy_ || this.target_,\n                          name: key,\n                          newValue: value\n                      } as const)\n                    : null\n\n            if (__DEV__ && notifySpy) {\n                spyReportStart(change!)\n            }\n            if (notify) {\n                notifyListeners(this, change)\n            }\n            if (__DEV__ && notifySpy) {\n                spyReportEnd()\n            }\n        }\n\n        this.pendingKeys_?.get(key)?.set(true)\n\n        // Notify \"keys/entries/values\" observers\n        this.keysAtom_.reportChanged()\n    }\n\n    ownKeys_(): ArrayLike<string | symbol> {\n        this.keysAtom_.reportObserved()\n        return ownKeys(this.target_)\n    }\n\n    keys_(): PropertyKey[] {\n        // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n        // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n        // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n        // We choose to over-report in Object.keys(object), because:\n        // - typically it's used with simple data objects\n        // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n        this.keysAtom_.reportObserved()\n        return Object.keys(this.target_)\n    }\n}\n\nexport interface IIsObservableObject {\n    $mobx: ObservableObjectAdministration\n}\n\nexport function asObservableObject(\n    target: any,\n    options?: CreateObservableOptions\n): IIsObservableObject {\n    if (__DEV__ && options && isObservableObject(target)) {\n        die(`Options can't be provided for already observable objects.`)\n    }\n\n    if (hasProp(target, $mobx)) {\n        if (__DEV__ && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n            die(\n                `Cannot convert '${getDebugName(target)}' into observable object:` +\n                    `\\nThe target is already observable of different type.` +\n                    `\\nExtending builtins is not supported.`\n            )\n        }\n        return target\n    }\n\n    if (__DEV__ && !Object.isExtensible(target)) {\n        die(\"Cannot make the designated object observable; it is not extensible\")\n    }\n\n    const name =\n        options?.name ??\n        (__DEV__\n            ? `${\n                  isPlainObject(target) ? \"ObservableObject\" : target.constructor.name\n              }@${getNextId()}`\n            : \"ObservableObject\")\n\n    const adm = new ObservableObjectAdministration(\n        target,\n        new Map(),\n        String(name),\n        getAnnotationFromOptions(options)\n    )\n\n    addHiddenProp(target, $mobx, adm)\n\n    return target\n}\n\nconst isObservableObjectAdministration = createInstanceofPredicate(\n    \"ObservableObjectAdministration\",\n    ObservableObjectAdministration\n)\n\nfunction getCachedObservablePropDescriptor(key) {\n    return (\n        descriptorCache[key] ||\n        (descriptorCache[key] = {\n            get() {\n                return this[$mobx].getObservablePropValue_(key)\n            },\n            set(value) {\n                return this[$mobx].setObservablePropValue_(key, value)\n            }\n        })\n    )\n}\n\nexport function isObservableObject(thing: any): boolean {\n    if (isObject(thing)) {\n        return isObservableObjectAdministration((thing as any)[$mobx])\n    }\n    return false\n}\n\nexport function recordAnnotationApplied(\n    adm: ObservableObjectAdministration,\n    annotation: Annotation,\n    key: PropertyKey\n) {\n    if (__DEV__) {\n        adm.appliedAnnotations_![key] = annotation\n    }\n    // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n    delete adm.target_[storedAnnotationsSymbol]?.[key]\n}\n\nfunction assertAnnotable(\n    adm: ObservableObjectAdministration,\n    annotation: Annotation,\n    key: PropertyKey\n) {\n    // Valid annotation\n    if (__DEV__ && !isAnnotation(annotation)) {\n        die(`Cannot annotate '${adm.name_}.${key.toString()}': Invalid annotation.`)\n    }\n\n    /*\n    // Configurable, not sealed, not frozen\n    // Possibly not needed, just a little better error then the one thrown by engine.\n    // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\n    if (__DEV__) {\n        const configurable = getDescriptor(adm.target_, key)?.configurable\n        const frozen = Object.isFrozen(adm.target_)\n        const sealed = Object.isSealed(adm.target_)\n        if (!configurable || frozen || sealed) {\n            const fieldName = `${adm.name_}.${key.toString()}`\n            const requestedAnnotationType = annotation.annotationType_\n            let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\n            if (frozen) {\n                error += `\\nObject is frozen.`\n            }\n            if (sealed) {\n                error += `\\nObject is sealed.`\n            }\n            if (!configurable) {\n                error += `\\nproperty is not configurable.`\n                // Mention only if caused by us to avoid confusion\n                if (hasProp(adm.appliedAnnotations!, key)) {\n                    error += `\\nTo prevent accidental re-definition of a field by a subclass, `\n                    error += `all annotated fields of non-plain objects (classes) are not configurable.`\n                }\n            }\n            die(error)\n        }\n    }\n    */\n\n    // Not annotated\n    if (__DEV__ && !isOverride(annotation) && hasProp(adm.appliedAnnotations_!, key)) {\n        const fieldName = `${adm.name_}.${key.toString()}`\n        const currentAnnotationType = adm.appliedAnnotations_![key].annotationType_\n        const requestedAnnotationType = annotation.annotationType_\n        die(\n            `Cannot apply '${requestedAnnotationType}' to '${fieldName}':` +\n                `\\nThe field is already annotated with '${currentAnnotationType}'.` +\n                `\\nRe-annotating fields is not allowed.` +\n                `\\nUse 'override' annotation for methods overridden by subclass.`\n        )\n    }\n}\n","import {\n    getNextId,\n    addHiddenFinalProp,\n    allowStateChangesStart,\n    allowStateChangesEnd,\n    makeIterable,\n    addHiddenProp,\n    ObservableArrayAdministration,\n    $mobx,\n    arrayExtensions,\n    IEnhancer,\n    isObservableArray,\n    IObservableArray,\n    defineProperty\n} from \"../internal\"\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nconst ENTRY_0 = createArrayEntryDescriptor(0)\n\nconst safariPrototypeSetterInheritanceBug = (() => {\n    let v = false\n    const p = {}\n    Object.defineProperty(p, \"0\", {\n        set: () => {\n            v = true\n        }\n    })\n    Object.create(p)[\"0\"] = 1\n    return v === false\n})()\n\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nlet OBSERVABLE_ARRAY_BUFFER_SIZE = 0\n\n// Typescript workaround to make sure ObservableArray extends Array\nclass StubArray {}\nfunction inherit(ctor, proto) {\n    if (Object.setPrototypeOf) {\n        Object.setPrototypeOf(ctor.prototype, proto)\n    } else if (ctor.prototype.__proto__ !== undefined) {\n        ctor.prototype.__proto__ = proto\n    } else {\n        ctor.prototype = proto\n    }\n}\ninherit(StubArray, Array.prototype)\n\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nclass LegacyObservableArray<T> extends StubArray {\n    constructor(\n        initialValues: T[] | undefined,\n        enhancer: IEnhancer<T>,\n        name = __DEV__ ? \"ObservableArray@\" + getNextId() : \"ObservableArray\",\n        owned = false\n    ) {\n        super()\n\n        const adm = new ObservableArrayAdministration(name, enhancer, owned, true)\n        adm.proxy_ = this as any\n        addHiddenFinalProp(this, $mobx, adm)\n\n        if (initialValues && initialValues.length) {\n            const prev = allowStateChangesStart(true)\n            // @ts-ignore\n            this.spliceWithArray(0, 0, initialValues)\n            allowStateChangesEnd(prev)\n        }\n\n        if (safariPrototypeSetterInheritanceBug) {\n            // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n            // defined on the instance. After that it works fine, even if this property is deleted.\n            Object.defineProperty(this, \"0\", ENTRY_0)\n        }\n    }\n\n    concat(...arrays: T[][]): T[] {\n        ;(this[$mobx] as ObservableArrayAdministration).atom_.reportObserved()\n        return Array.prototype.concat.apply(\n            (this as any).slice(),\n            //@ts-ignore\n            arrays.map(a => (isObservableArray(a) ? a.slice() : a))\n        )\n    }\n\n    get length(): number {\n        return (this[$mobx] as ObservableArrayAdministration).getArrayLength_()\n    }\n\n    set length(newLength: number) {\n        ;(this[$mobx] as ObservableArrayAdministration).setArrayLength_(newLength)\n    }\n\n    get [Symbol.toStringTag]() {\n        return \"Array\"\n    }\n\n    [Symbol.iterator]() {\n        const self = this\n        let nextIndex = 0\n        return makeIterable({\n            next() {\n                return nextIndex < self.length\n                    ? { value: self[nextIndex++], done: false }\n                    : { done: true, value: undefined }\n            }\n        })\n    }\n}\n\nObject.entries(arrayExtensions).forEach(([prop, fn]) => {\n    if (prop !== \"concat\") {\n        addHiddenProp(LegacyObservableArray.prototype, prop, fn)\n    }\n})\n\nfunction createArrayEntryDescriptor(index: number) {\n    return {\n        enumerable: false,\n        configurable: true,\n        get: function () {\n            return this[$mobx].get_(index)\n        },\n        set: function (value) {\n            this[$mobx].set_(index, value)\n        }\n    }\n}\n\nfunction createArrayBufferItem(index: number) {\n    defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index))\n}\n\nexport function reserveArrayBuffer(max: number) {\n    if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n        for (let index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n            createArrayBufferItem(index)\n        }\n        OBSERVABLE_ARRAY_BUFFER_SIZE = max\n    }\n}\n\nreserveArrayBuffer(1000)\n\nexport function createLegacyArray<T>(\n    initialValues: T[] | undefined,\n    enhancer: IEnhancer<T>,\n    name?: string\n): IObservableArray<T> {\n    return new LegacyObservableArray(initialValues, enhancer, name) as any\n}\n","import { isAction } from \"../api/action\"\nimport {\n    $mobx,\n    IDepTreeNode,\n    isAtom,\n    isComputedValue,\n    isObservableArray,\n    isObservableMap,\n    isObservableObject,\n    isReaction,\n    isObservableSet,\n    die,\n    isFunction\n} from \"../internal\"\n\nexport function getAtom(thing: any, property?: PropertyKey): IDepTreeNode {\n    if (typeof thing === \"object\" && thing !== null) {\n        if (isObservableArray(thing)) {\n            if (property !== undefined) {\n                die(23)\n            }\n            return (thing as any)[$mobx].atom_\n        }\n        if (isObservableSet(thing)) {\n            return (thing as any)[$mobx]\n        }\n        if (isObservableMap(thing)) {\n            if (property === undefined) {\n                return thing.keysAtom_\n            }\n            const observable = thing.data_.get(property) || thing.hasMap_.get(property)\n            if (!observable) {\n                die(25, property, getDebugName(thing))\n            }\n            return observable\n        }\n        if (property && !thing[$mobx]) {\n            thing[property]\n        } // See #1072\n        if (isObservableObject(thing)) {\n            if (!property) {\n                return die(26)\n            }\n            const observable = (thing as any)[$mobx].values_.get(property)\n            if (!observable) {\n                die(27, property, getDebugName(thing))\n            }\n            return observable\n        }\n        if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n            return thing\n        }\n    } else if (isFunction(thing)) {\n        if (isReaction(thing[$mobx])) {\n            // disposer function\n            return thing[$mobx]\n        }\n    }\n    die(28)\n}\n\nexport function getAdministration(thing: any, property?: string) {\n    if (!thing) {\n        die(29)\n    }\n    if (property !== undefined) {\n        return getAdministration(getAtom(thing, property))\n    }\n    if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n        return thing\n    }\n    if (isObservableMap(thing) || isObservableSet(thing)) {\n        return thing\n    }\n    if (thing[$mobx]) {\n        return thing[$mobx]\n    }\n    die(24, thing)\n}\n\nexport function getDebugName(thing: any, property?: string): string {\n    let named\n    if (property !== undefined) {\n        named = getAtom(thing, property)\n    } else if (isAction(thing)) {\n        return thing.name\n    } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n        named = getAdministration(thing)\n    } else {\n        // valid for arrays as well\n        named = getAtom(thing)\n    }\n    return named.name_\n}\n","import {\n    isES6Map,\n    isObservableArray,\n    isObservableMap,\n    isES6Set,\n    isObservableSet,\n    hasProp,\n    isFunction,\n    objectPrototype\n} from \"../internal\"\n\ndeclare const Symbol\nconst toString = objectPrototype.toString\n\nexport function deepEqual(a: any, b: any, depth: number = -1): boolean {\n    return eq(a, b, depth)\n}\n\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a: any, b: any, depth: number, aStack?: any[], bStack?: any[]) {\n    // Identical objects are equal. `0 === -0`, but they aren't identical.\n    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n    if (a === b) {\n        return a !== 0 || 1 / a === 1 / b\n    }\n    // `null` or `undefined` only equal to itself (strict comparison).\n    if (a == null || b == null) {\n        return false\n    }\n    // `NaN`s are equivalent, but non-reflexive.\n    if (a !== a) {\n        return b !== b\n    }\n    // Exhaust primitive checks\n    const type = typeof a\n    if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n        return false\n    }\n\n    // Compare `[[Class]]` names.\n    const className = toString.call(a)\n    if (className !== toString.call(b)) {\n        return false\n    }\n    switch (className) {\n        // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n        case \"[object RegExp]\":\n        // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n        case \"[object String]\":\n            // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n            // equivalent to `new String(\"5\")`.\n            return \"\" + a === \"\" + b\n        case \"[object Number]\":\n            // `NaN`s are equivalent, but non-reflexive.\n            // Object(NaN) is equivalent to NaN.\n            if (+a !== +a) {\n                return +b !== +b\n            }\n            // An `egal` comparison is performed for other numeric values.\n            return +a === 0 ? 1 / +a === 1 / b : +a === +b\n        case \"[object Date]\":\n        case \"[object Boolean]\":\n            // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n            // millisecond representations. Note that invalid dates with millisecond representations\n            // of `NaN` are not equivalent.\n            return +a === +b\n        case \"[object Symbol]\":\n            return (\n                typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b)\n            )\n        case \"[object Map]\":\n        case \"[object Set]\":\n            // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n            // Hide this extra level by increasing the depth.\n            if (depth >= 0) {\n                depth++\n            }\n            break\n    }\n    // Unwrap any wrapped objects.\n    a = unwrap(a)\n    b = unwrap(b)\n\n    const areArrays = className === \"[object Array]\"\n    if (!areArrays) {\n        if (typeof a != \"object\" || typeof b != \"object\") {\n            return false\n        }\n\n        // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n        // from different frames are.\n        const aCtor = a.constructor,\n            bCtor = b.constructor\n        if (\n            aCtor !== bCtor &&\n            !(\n                isFunction(aCtor) &&\n                aCtor instanceof aCtor &&\n                isFunction(bCtor) &&\n                bCtor instanceof bCtor\n            ) &&\n            \"constructor\" in a &&\n            \"constructor\" in b\n        ) {\n            return false\n        }\n    }\n\n    if (depth === 0) {\n        return false\n    } else if (depth < 0) {\n        depth = -1\n    }\n\n    // Assume equality for cyclic structures. The algorithm for detecting cyclic\n    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n    // Initializing stack of traversed objects.\n    // It's done here since we only need them for objects and arrays comparison.\n    aStack = aStack || []\n    bStack = bStack || []\n    let length = aStack.length\n    while (length--) {\n        // Linear search. Performance is inversely proportional to the number of\n        // unique nested structures.\n        if (aStack[length] === a) {\n            return bStack[length] === b\n        }\n    }\n\n    // Add the first object to the stack of traversed objects.\n    aStack.push(a)\n    bStack.push(b)\n\n    // Recursively compare objects and arrays.\n    if (areArrays) {\n        // Compare array lengths to determine if a deep comparison is necessary.\n        length = a.length\n        if (length !== b.length) {\n            return false\n        }\n        // Deep compare the contents, ignoring non-numeric properties.\n        while (length--) {\n            if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n                return false\n            }\n        }\n    } else {\n        // Deep compare objects.\n        const keys = Object.keys(a)\n        let key\n        length = keys.length\n        // Ensure that both objects contain the same number of properties before comparing deep equality.\n        if (Object.keys(b).length !== length) {\n            return false\n        }\n        while (length--) {\n            // Deep compare each member\n            key = keys[length]\n            if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n                return false\n            }\n        }\n    }\n    // Remove the first object from the stack of traversed objects.\n    aStack.pop()\n    bStack.pop()\n    return true\n}\n\nfunction unwrap(a: any) {\n    if (isObservableArray(a)) {\n        return a.slice()\n    }\n    if (isES6Map(a) || isObservableMap(a)) {\n        return Array.from(a.entries())\n    }\n    if (isES6Set(a) || isObservableSet(a)) {\n        return Array.from(a.entries())\n    }\n    return a\n}\n","export function makeIterable<T>(iterator: Iterator<T>): IterableIterator<T> {\n    iterator[Symbol.iterator] = getSelf\n    return iterator as any\n}\n\nfunction getSelf() {\n    return this\n}\n","import { ObservableObjectAdministration, isFunction } from \"../internal\"\n\nexport const enum MakeResult {\n    Cancel,\n    Break,\n    Continue\n}\n\nexport type Annotation = {\n    annotationType_: string\n    make_(\n        adm: ObservableObjectAdministration,\n        key: PropertyKey,\n        descriptor: PropertyDescriptor,\n        source: object\n    ): MakeResult\n    extend_(\n        adm: ObservableObjectAdministration,\n        key: PropertyKey,\n        descriptor: PropertyDescriptor,\n        proxyTrap: boolean\n    ): boolean | null\n    options_?: any\n}\n\nexport type AnnotationMapEntry =\n    | Annotation\n    | true /* follow the default decorator, usually deep */\n    | false /* don't decorate this property */\n\n// AdditionalFields can be used to declare additional keys that can be used, for example to be able to\n// declare annotations for private/ protected members, see #2339\nexport type AnnotationsMap<T, AdditionalFields extends PropertyKey> = {\n    [P in Exclude<keyof T, \"toString\">]?: AnnotationMapEntry\n} & Record<AdditionalFields, AnnotationMapEntry>\n\nexport function isAnnotation(thing: any) {\n    return (\n        // Can be function\n        thing instanceof Object &&\n        typeof thing.annotationType_ === \"string\" &&\n        isFunction(thing.make_) &&\n        isFunction(thing.extend_)\n    )\n}\n\nexport function isAnnotationMapEntry(thing: any) {\n    return typeof thing === \"boolean\" || isAnnotation(thing)\n}\n","/**\n * (c) Michel Weststrate 2015 - 2020\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/     Most of the public static methods exposed by the module can be found here.\n * - core/    Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/   All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/   Utility stuff.\n *\n */\nimport { die } from \"./errors\"\nimport { getGlobal } from \"./utils/global\"\n;[\"Symbol\", \"Map\", \"Set\"].forEach(m => {\n    let g = getGlobal()\n    if (typeof g[m] === \"undefined\") {\n        die(`MobX requires global '${m}' to be available or polyfilled`)\n    }\n})\n\nimport { spy, getDebugName, $mobx } from \"./internal\"\n\nexport {\n    IObservable,\n    IDepTreeNode,\n    Reaction,\n    IReactionPublic,\n    IReactionDisposer,\n    untracked,\n    IAtom,\n    createAtom,\n    spy,\n    IComputedValue,\n    IEqualsComparer,\n    comparer,\n    IEnhancer,\n    IInterceptable,\n    IInterceptor,\n    IListenable,\n    IObjectWillChange,\n    IObjectDidChange,\n    isObservableObject,\n    IValueDidChange,\n    IValueWillChange,\n    IObservableValue,\n    isObservableValue as isBoxedObservable,\n    IObservableArray,\n    IArrayWillChange,\n    IArrayWillSplice,\n    IArraySplice,\n    IArrayUpdate,\n    IArrayDidChange,\n    isObservableArray,\n    IKeyValueMap,\n    ObservableMap,\n    IMapEntries,\n    IMapEntry,\n    IMapWillChange,\n    IMapDidChange,\n    isObservableMap,\n    IObservableMapInitialValues,\n    ObservableSet,\n    isObservableSet,\n    ISetDidChange,\n    ISetWillChange,\n    IObservableSetInitialValues,\n    transaction,\n    observable,\n    IObservableFactory,\n    CreateObservableOptions,\n    computed,\n    IComputedFactory,\n    isObservable,\n    isObservableProp,\n    isComputed,\n    isComputedProp,\n    extendObservable,\n    observe,\n    intercept,\n    autorun,\n    IAutorunOptions,\n    reaction,\n    IReactionOptions,\n    when,\n    IWhenOptions,\n    action,\n    isAction,\n    runInAction,\n    IActionFactory,\n    keys,\n    values,\n    entries,\n    set,\n    remove,\n    has,\n    get,\n    apiOwnKeys as ownKeys,\n    apiDefineProperty as defineProperty,\n    configure,\n    onBecomeObserved,\n    onBecomeUnobserved,\n    flow,\n    isFlow,\n    flowResult,\n    FlowCancellationError,\n    isFlowCancellationError,\n    toJS,\n    trace,\n    IObserverTree,\n    IDependencyTree,\n    getDependencyTree,\n    getObserverTree,\n    resetGlobalState as _resetGlobalState,\n    getGlobalState as _getGlobalState,\n    getDebugName,\n    getAtom,\n    getAdministration as _getAdministration,\n    allowStateChanges as _allowStateChanges,\n    runInAction as _allowStateChangesInsideComputed, // This has become the default behavior in Mobx 6\n    Lambda,\n    $mobx,\n    isComputingDerivation as _isComputingDerivation,\n    onReactionError,\n    interceptReads as _interceptReads,\n    IComputedValueOptions,\n    IActionRunInfo,\n    _startAction,\n    _endAction,\n    allowStateReadsStart as _allowStateReadsStart,\n    allowStateReadsEnd as _allowStateReadsEnd,\n    makeObservable,\n    makeAutoObservable,\n    autoAction as _autoAction,\n    AnnotationsMap,\n    AnnotationMapEntry,\n    override\n} from \"./internal\"\n\n// Devtools support\ndeclare const __MOBX_DEVTOOLS_GLOBAL_HOOK__: { injectMobx: (any) => void }\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n    // See: https://github.com/andykog/mobx-devtools/\n    __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n        spy,\n        extras: {\n            getDebugName\n        },\n        $mobx\n    })\n}\n"]},"metadata":{},"sourceType":"module"}